Files
PatientMgr-CSharp/SaPatMgrWinDbas/Win/Dbas/Mgr/SpmInstitutionMgr_Dbas-Employee.cs
T
2019-05-16 15:20:54 +01:00

542 lines
22 KiB
C#

using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sarand.Core.App;
using Sarand.Core.Base;
using Sarand.Core.Bus;
using Sarand.Core.Dbas.Base;
using Sarand.Win.Dbas.Base;
using Sarand.PatientMgr.Core.App;
using Sarand.PatientMgr.Core.Bus;
using Sarand.PatientMgr.Core.Mgr;
using Sarand.PatientMgr.Win.Dbas.Bus;
using Sarand.PatientMgr.Win.Dbas.Internal;
//using Sarand.PatientMgr.Win.Dbas.UpdateLog;
using Sarand.Win.Dbas.Data;
namespace Sarand.PatientMgr.Win.Dbas.Mgr
{
//=======================================================================
internal partial class SpmInstitutionMgr_Dbas : SpmInstitutionMgr
{
//*******************************************************************
// E m p l o y e e
//*******************************************************************
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Utilities.
//-------------------------------------------------------------------
// Employee exists.
public override bool EmployeeExistsById(SysId employeeId)
{
ClearErrorState();
if (!SysId.IsValid(employeeId)) return false;
SpmEmployee.Params prmEmployee = new SpmEmployee.Params();
prmEmployee.IncludedIds.Add(employeeId);
prmEmployee.StatusCat = SpmEmployee.StatusCat.Any;
return GetEmployeeCount(prmEmployee) == 1;
}
//-------------------------------------------------------------------
// Get Employee.
public override SpmEmployee GetEmployee(SpmEmployee.Params prm)
{
return GetEmployee(GetEmployeeQueryFilter(prm).Concat(" AND ", "(", ")"));
}
private SpmEmployee GetEmployee(String filter)
{
ClearErrorState();
long count = GetEmployeeCount(filter);
if (count == 0) return null;
if (count != 1)
{
SetErrorState("Multiple Employeees found");
return null;
}
SpmEmployee employee = null;
// Query data.
using (var dbConnection = db.CreateConnection())
using (var dbCommand = dbConnection.CreateCommand())
{
try
{
dbConnection.Open();
SwmEmployee_Db dbEmployee = new SwmEmployee_Db(DbInfo);
dbEmployee.PopulateFrom(dbCommand, aliasEmployee, filter);
employee = CreateEmployee(dbEmployee);
}
catch (Exception exc)
{
SetErrorState("Database query exception");
Logger.Warn(GetType().Name + ".GetEmployee\n\tQuery: " + dbCommand.CommandText + "\n\tException: " + exc.Message);
}
}
return employee;
}
public override SpmEmployee GetEmployeeById(SysId employeeId)
{
ClearErrorState();
if (!SysId.IsValid(employeeId)) return null;
SpmEmployee.Params prmEmployee = new SpmEmployee.Params();
prmEmployee.IncludedIds.Add(employeeId);
prmEmployee.StatusCat = SpmEmployee.StatusCat.Any;
return GetEmployee(prmEmployee);
}
//-------------------------------------------------------------------
// Create Employee.
public override SpmEmployee CreateEmployee(SysId id, SysId institutionId)
{
return new SpmEmployee_Dbas(UserContext, id, institutionId, 0);
}
private SpmEmployee_Dbas CreateEmployee(SwmEmployee_Db dbEmployee)
{
ClearErrorState();
SpmEmployee_Dbas employee = new SpmEmployee_Dbas(UserContext, new SysId(dbEmployee._Id), new SysId(dbEmployee._InstitutionId), (ushort)dbEmployee._Flags);
PopulateFrom(dbEmployee, employee);
return employee;
}
//-------------------------------------------------------------------
// Validate Employee.
public override bool IsValidEmployeeData(SpmEmployee.Data data, SpmEmployee.ErrField errField)
{
ClearErrorState();
if (!base.IsValidEmployeeData(data, errField)) return false;
return true;
}
//-------------------------------------------------------------------
// Insert Employee.
public override bool InsertEmployee(SpmEmployee employee, DbUpdateInfo dbUpdateInfo)
{
ClearErrorState();
if (!IsValidEmployee(employee)) return false;
if (SysId.IsValid(employee.Id)) return SetErrorState(ErrorMessage.ValiditemId);
using (var dbConnection = db.CreateConnection())
using (var dbCommand = dbConnection.CreateCommand())
{
try
{
dbConnection.Open();
SwmEmployee_Db dbEmployee = new SwmEmployee_Db(DbInfo);
PopulateTo(dbEmployee, employee, dbUpdateInfo);
if (SwmEmployee_Db.FieldsNonId.Contains("Id"))
{
// Generate next Id.
dbEmployee._Id = SysId.ToInt(db.GetNextId("Employee", dbUpdateInfo));
}
dbEmployee.ExecuteInsertCommand(dbCommand);
employee.Id = new SysId(dbEmployee._Id);
}
catch (Exception exc) { SetErrorState(exc.Message); }
}
return !HasErrorState();
}
//-------------------------------------------------------------------
// Update Employee.
public override bool UpdateEmployee(SpmEmployee employee, DbUpdateInfo dbUpdateInfo)
{
ClearErrorState();
if (!IsValidEmployee(employee)) return false;
if (!SysId.IsValid(employee.Id)) return SetErrorState(ErrorMessage.InvalidItemId);
using (var dbConnection = db.CreateConnection())
using (var dbCommand = dbConnection.CreateCommand())
{
try
{
// Retrieve Employee.
dbConnection.Open();
SwmEmployee_Db dbEmployee = new SwmEmployee_Db(DbInfo);
dbEmployee.PopulateFrom(dbCommand, aliasEmployee, "Id=" + SysId.ToString(employee.Id));
//SpmUpdateLogItemMonitor_Employee updateLogMonitor = new SpmUpdateLogItemMonitor_Employee(UserContext, CreateEmployee(dbEmployee));
// Update properties.
PopulateTo(dbEmployee, employee, dbUpdateInfo);
dbEmployee.ExecuteUpdateCommand(dbCommand);
/* Record updates.
updateLogMonitor.RecordUpdatedValues(employee);
updateLogMonitor.LogUpdates();*/
}
catch (Exception exc) { SetErrorState(exc.Message); }
}
return !HasErrorState();
}
//-------------------------------------------------------------------
// Delete Employee.
public override bool EmployeeCanBeDeleted(SpmEmployee employee)
{
ClearErrorState();
if (!base.EmployeeCanBeDeleted(employee)) return false;
return true;
}
public override bool DeleteEmployee(SpmEmployee employee, DbUpdateInfo dbUpdateInfo)
{
ClearErrorState();
if (!EmployeeCanBeDeleted(employee)) return false;
using (var dbConnection = db.CreateConnection())
using (var dbCommand = dbConnection.CreateCommand())
{
try
{
// Retrieve Employee.
dbConnection.Open();
SwmEmployee_Db dbEmployee = new SwmEmployee_Db(DbInfo);
dbEmployee.PopulateFrom(dbCommand, aliasEmployee, "Id=" + employee.Id.ToString());
// Delete Employee.
dbCommand.CommandType = System.Data.CommandType.Text;
dbCommand.CommandText = "DELETE FROM " + SpmDbDfn.GetTableName(SpmDbDfn.TableIdx.SwmEmployee) + " WHERE Id=" + SysId.ToString(employee.Id) + ";";
dbCommand.ExecuteNonQuery();
}
catch (Exception exc) { SetErrorState(exc.Message); }
}
return !HasErrorState();
}
//-------------------------------------------------------------------
// Copy data properties to and from database.
private void PopulateTo(SwmEmployee_Db dbEmployee, SpmEmployee employee, DbUpdateInfo dbUpdateInfo)
{
dbEmployee._Id = employee.Id.ToInt();
dbEmployee._EmployeeNo = employee.EmployeeNo;
dbEmployee._Code = employee.Code;
dbEmployee._Initials = employee.Initials;
dbEmployee._Title = employee.Title;
dbEmployee._Surname = employee.Surname;
dbEmployee._Forename = employee.Forename;
dbEmployee._Notes = employee.Notes;
dbEmployee._Status = SacsSystem.GetStatusCode(employee.Status);
dbEmployee._Flags = (short)employee.Flags;
if (!SysId.IsValid(employee.Id))
{
dbEmployee._CreateOn = DateTime.UtcNow;
dbEmployee._CreateBy = dbUpdateInfo.UserId.ToInt();
dbEmployee._CreateHost = dbUpdateInfo.Host;
}
dbEmployee._UpdateOn = DateTime.UtcNow;
dbEmployee._UpdateBy = dbUpdateInfo.UserId.ToInt();
dbEmployee._UpdateHost = dbUpdateInfo.Host;
}
private void PopulateFrom(SwmEmployee_Db dbEmployee, SpmEmployee employee)
{
employee.Id = new SysId(dbEmployee._Id);
employee.EmployeeNo = dbEmployee._EmployeeNo;
employee.Code = dbEmployee._Code;
employee.Initials = dbEmployee._Initials;
employee.Title = dbEmployee._Title;
employee.Surname = dbEmployee._Surname;
employee.Forename = dbEmployee._Forename;
employee.Notes = dbEmployee._Notes;
employee.Status = SacsSystem.GetStatusForCode(dbEmployee._Status);
employee.SetCreateStamp(dbEmployee._CreateOn, new SysId(dbEmployee._CreateBy), dbEmployee._CreateHost);
employee.SetUpdateStamp(dbEmployee._UpdateOn, new SysId(dbEmployee._UpdateBy), dbEmployee._UpdateHost);
employee.AcceptChanges();
}
//-------------------------------------------------------------------
// Employee column definitions.
private static readonly String aliasEmployee = "aAdmAct";
private void SetEmployeeColDfn
(ColumnDfn col, String caption, int width, SpmDbDfn.ColumnIdx dbCol,
ColumnAlignment align = ColumnAlignment.Default, DataValue.DataType dataType = DataValue.DataType.String,
String alias = "", String prefix = "")
{
if (String.IsNullOrEmpty(alias) && SpmDbDfn.GetTableForColumn(dbCol) == SpmDbDfn.TableIdx.SwmEmployee)
alias = aliasEmployee;
col.Set(caption, width, (int)dbCol, prefix + SpmDbDfn.GetColumnName(dbCol, false), SpmDbDfn.GetColumnNameQual(dbCol, alias), dataType, align);
if (dataType == DataValue.DataType.String && dbCol != SpmDbDfn.ColumnIdx.Unknown)
col.MaxLength = (int)SpmDbDfn.GetColTextLen(dbCol);
}
//-------------------------------------------------------------------
// Getting prmEmployee column definition.
public override ColumnDfn GetEmployeeColumnDfn(SpmEmployee.Column columnId, string caption = "", int width = 0)
{
ColumnDfn columnDfn = new ColumnDfn((int)columnId, caption, width);
switch (columnId)
{
case SpmEmployee.Column.Pos:
SetEmployeeColDfn(columnDfn, "Pos", 42, SpmDbDfn.ColumnIdx.Unknown, ColumnAlignment.Right);
columnDfn.SortMode = ColumnDfn.ColumnSortMode.Off;
columnDfn.ReadOnly = true;
columnDfn.Resizable = false;
break;
case SpmEmployee.Column.Id:
SetEmployeeColDfn(columnDfn, "Id", 40, SpmDbDfn.ColumnIdx.SwmEmployee_Id, ColumnAlignment.Right, DataValue.DataType.Long);
columnDfn.ReadOnly = true;
break;
// Employee Properties.
case SpmEmployee.Column.InstitutionId:
SetEmployeeColDfn(columnDfn, "InstitutionId", 40, SpmDbDfn.ColumnIdx.SwmEmployee_InstitutionId, ColumnAlignment.Right, DataValue.DataType.Long);
columnDfn.ReadOnly = true;
break;
case SpmEmployee.Column.EmployeeNo:
SetEmployeeColDfn(columnDfn, "EmployeeNo", 60, SpmDbDfn.ColumnIdx.SwmEmployee_EmployeeNo, ColumnAlignment.Center, DataValue.DataType.String);
break;
case SpmEmployee.Column.Code:
SetEmployeeColDfn(columnDfn, "Code", 60, SpmDbDfn.ColumnIdx.SwmEmployee_Code, ColumnAlignment.Center, DataValue.DataType.String);
break;
case SpmEmployee.Column.Initials:
SetEmployeeColDfn(columnDfn, "Initials", 90, SpmDbDfn.ColumnIdx.SwmEmployee_Initials);
break;
case SpmEmployee.Column.Title:
SetEmployeeColDfn(columnDfn, "Title", 90, SpmDbDfn.ColumnIdx.SwmEmployee_Title);
break;
case SpmEmployee.Column.Surname:
SetEmployeeColDfn(columnDfn, "Surname", 90, SpmDbDfn.ColumnIdx.SwmEmployee_Surname);
break;
case SpmEmployee.Column.Forename:
SetEmployeeColDfn(columnDfn, "Forename", 90, SpmDbDfn.ColumnIdx.SwmEmployee_Forename);
break;
// Common properties.
case SpmEmployee.Column.Notes:
SetEmployeeColDfn(columnDfn, "Notes", 200, SpmDbDfn.ColumnIdx.SwmEmployee_Notes);
break;
case SpmEmployee.Column.Status:
SetEmployeeColDfn(columnDfn, "Status", 50, SpmDbDfn.ColumnIdx.SwmEmployee_Status, ColumnAlignment.Center);
break;
case SpmEmployee.Column.Status_Desc:
SetEmployeeColDfn(columnDfn, "Status", 50, SpmDbDfn.ColumnIdx.SwmEmployee_Status, ColumnAlignment.Center);
break;
case SpmEmployee.Column.Status_Ind:
SetEmployeeColDfn(columnDfn, "Status", 50, SpmDbDfn.ColumnIdx.SwmEmployee_Status, ColumnAlignment.Center, DataValue.DataType.TriState);
columnDfn.TriStateFormat = ColumnTriStateFormat.Lights;
break;
case SpmEmployee.Column.CreateOn_Date:
SetEmployeeColDfn(columnDfn, "Created", 65, SpmDbDfn.ColumnIdx.SwmEmployee_CreateOn, ColumnAlignment.Center, DataValue.DataType.Date);
columnDfn.ReadOnly = true;
break;
case SpmEmployee.Column.UpdateOn_Date:
SetEmployeeColDfn(columnDfn, "Updated", 65, SpmDbDfn.ColumnIdx.SwmEmployee_UpdateOn, ColumnAlignment.Center, DataValue.DataType.Date);
columnDfn.ReadOnly = true;
break;
}
if (!String.IsNullOrEmpty(caption))
columnDfn.Caption = caption;
if (width > 0)
columnDfn.Width = width;
return columnDfn;
}
//-------------------------------------------------------------------
// Employee query filter.
public override List<string> GetEmployeeQueryFilter(SpmEmployee.Params prm)
{
List<String> filters = new List<String>();
// Employee Id.
String includedIds = prm.IncludedIds.Concat(",");
if (!includedIds.IsEmpty())
filters.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Id, aliasEmployee) + " IN (" + includedIds + ")");
String excludedIds = prm.ExcludedIds.Concat(",");
if (!excludedIds.IsEmpty())
filters.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Id, aliasEmployee) + " NOT IN (" + excludedIds + ")");
// Institution Id.
String colInstitutionId = SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmOperation_InstitutionId, aliasOperation);
if (SysId.IsValid(prm.InstitutionId))
filters.Add(colInstitutionId + "=" + prm.InstitutionId.ToString());
// Employee Number.
String employeeNo = DbQuery.FormatForCondition(prm.EmployeeNo);
String colEmployeeNo = SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_EmployeeNo, aliasEmployee);
if (!StringUtil.IsEmpty(employeeNo))
filters.Add(DbQuery.FormatFn_Left(colEmployeeNo, employeeNo.Length) + "='" + employeeNo + "'");
// Code.
String code = DbQuery.FormatForCondition(prm.Code);
String sColCode = SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Code, aliasEmployee);
if (!StringUtil.IsEmpty(code))
filters.Add(DbQuery.FormatFn_Left(sColCode, code.Length) + "='" + code + "'");
// Partial name.
String surname = DbQuery.FormatForCondition(prm.Surname);
String sColName = SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Surname, aliasEmployee);
if (!StringUtil.IsEmpty(surname))
filters.Add(DbQuery.FormatFn_Left(sColName, surname.Length) + "='" + surname + "'");
if (filters.Count < 1) filters.Add("1=1");
return filters;
}
//-------------------------------------------------------------------
// Employee sort columns.
public List<String> GetEmployeeSortColumns(SpmEmployee.Params prm)
{
// Sort sequence:
List<String> sortColumnNames = new List<String>();
foreach (var columnDfn in prm.SortColumns)
{
// Need to ensure correct alias used for Employee columns in case of conflict.
String sortCol = String.Empty;
if (SpmDbDfn.GetTableForColumn((SpmDbDfn.ColumnIdx)columnDfn.DbColumn) == SpmDbDfn.TableIdx.SwmEmployee)
{
sortCol = SpmDbDfn.GetColumnNameQual((SpmDbDfn.ColumnIdx)columnDfn.DbColumn, aliasEmployee);
}
else
{
sortCol = columnDfn.DataName;
if (!StringUtil.IsEmpty(columnDfn.SortDataName))
sortCol = columnDfn.SortDataName;
}
if (!sortCol.IsEmpty())
{
DbOrderByNullMode orderByNullMode = DbOrderByNullMode.Default; // eSaOrderByDemoteNulls, eSaOrderByPromoteNulls
sortColumnNames.Add(DbQuery.FormatForOrderBy(sortCol, columnDfn.SortAscending, orderByNullMode).Concat(", "));
}
}
sortColumnNames.RemoveBlanks();
if (sortColumnNames.IsEmpty())
{
// Default sort columns:
//sortColumnNames.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Type, aliasEmployee) + " ASC");
}
return sortColumnNames;
}
//-------------------------------------------------------------------
// Employee count.
private long GetEmployeeCount(String filter)
{
ClearErrorState();
return db.GetRowCount(SpmDbDfn.GetTableName(SpmDbDfn.TableIdx.SwmEmployee) + " As " + aliasEmployee, filter);
}
public override long GetEmployeeCount(SpmEmployee.Params prm)
{
ClearErrorState();
return GetEmployeeCount(GetEmployeeQueryFilter(prm).Concat(" AND ", "(", ")"));
}
//-------------------------------------------------------------------
// Employee list.
public override List<SpmEmployee> GetEmployeeList(SpmEmployee.Params prm)
{
List<SpmEmployee> Employeees = new List<SpmEmployee>();
DbQuery qry = new DbQuery(db.DbmsType);
qry.Tables.Add(SpmDbDfn.GetTableName(SpmDbDfn.TableIdx.SwmEmployee), aliasEmployee);
qry.Columns.AddRange(SwmEmployee_Db.Fields);
qry.Filters.AddRange(GetEmployeeQueryFilter(prm));
// Query data.
using (var dbConnection = db.CreateConnection())
using (var dbCommand = dbConnection.CreateCommand())
{
try
{
dbConnection.Open();
dbCommand.CommandText = qry.BuildQuery();
using (DbDataReader dbDataReader = dbCommand.ExecuteReader())
{
while (dbDataReader.Read())
{
SwmEmployee_Db dbEmployee = new SwmEmployee_Db(DbInfo);
dbEmployee.PopulateFrom(dbDataReader);
Employeees.Add(CreateEmployee(dbEmployee));
}
}
}
catch (Exception exc)
{
Logger.Warn(GetType().Name + ".GetEmployeeList\n\tQuery: " + dbCommand.CommandText + "\n\tException: " + exc.Message);
}
}
return Employeees;
}
//-------------------------------------------------------------------
// Employee query execution.
public override DbResultSet ExecuteEmployeeQuery(List<ColumnDfn> columns, SpmEmployee.Params prm)
{
ClearErrorState();
//---------------------------------------------------------------
// Construct query.
DbQuery query = new DbQuery(db.DbmsType);
query.Tables.Add(SpmDbDfn.GetTableName(SpmDbDfn.TableIdx.SwmEmployee), aliasEmployee);
// Employee Properties - add columns as defined in query list.
if (columns.HasId((int)SpmEmployee.Column.Id))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Id, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.EmployeeNo))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_EmployeeNo, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.Code))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Code, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.Initials))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Initials, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.Title))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Title, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.Forename))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Forename, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.Surname))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Surname, aliasEmployee));
// Common Properties
if (columns.HasId((int)SpmEmployee.Column.Notes))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Notes, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.Status) || columns.HasId((int)SpmEmployee.Column.Status_Desc) || columns.HasId((int)SpmEmployee.Column.Status_Ind))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_Status, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.CreateOn_Date))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_CreateOn, aliasEmployee));
if (columns.HasId((int)SpmEmployee.Column.UpdateOn_Date))
query.Columns.Add(SpmDbDfn.GetColumnNameQual(SpmDbDfn.ColumnIdx.SwmEmployee_UpdateOn, aliasEmployee));
//---------------------------------------------------------------
// Populate filter.
query.Filters.AddRange(GetEmployeeQueryFilter(prm));
if (prm.IncludedIds.Count != 1)
{
// Configure sort sequence.
foreach (String sortColumn in GetEmployeeSortColumns(prm))
query.OrderBy.Add(sortColumn);
}
//---------------------------------------------------------------
//return new DbResultSet_DataTableReader(db, query.BuildQuery());
return new Sarand.Win.Dbas.Data.DbResultSet_DataReader(db, query.BuildQuery());
}
//-------------------------------------------------------------------
public override DataValue GetEmployeeDataValue(ColumnDfn column, NamedValue.Map values)
{
DataValue value = new DataValue();
switch ((SpmEmployee.Column)column.Id)
{
// Notes.
case SpmEmployee.Column.Notes:
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
break;
// Status.
case SpmEmployee.Column.Status_Desc:
case SpmEmployee.Column.Status_Ind:
{
String statusCode = values.GetValue(column.DataName).ToString();
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
if (column.Id == (int)SpmEmployee.Column.Status_Desc)
value = new DataValue(SacsSystem.GetStatusDescForCode(statusCode));
else if (column.Id == (int)SpmEmployee.Column.Status_Ind)
value = new DataValue(SpmEmployee.GetStatusTriState(status));
}
break;
//-----------------------------------------------------------
}
return value;
}
//-------------------------------------------------------------------
}
//=======================================================================
}