public EmployeeSalary GetAdjustSalaryHistoryByPKID(int id) { SqlCommand cmd = new SqlCommand(); cmd.Parameters.Add(_ParmPKID, SqlDbType.Int).Value = id; using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetAdjustSalaryHistoryByPKID", cmd)) { while (sdr.Read()) { EmployeeSalary iRet = new EmployeeSalary((int)sdr[_DBEmployeeID]); AdjustSalaryHistory adjustSalaryHistory = new AdjustSalaryHistory(); adjustSalaryHistory.AdjustSalaryHistoryID = id; adjustSalaryHistory.AccountsBackName = sdr[_DBAccountsBackName].ToString(); adjustSalaryHistory.Description = sdr[_DBDescription].ToString(); adjustSalaryHistory.ChangeDate = (DateTime)sdr[_DBChangeDate]; adjustSalaryHistory.AccountSet = new AccountSet(0, sdr[_DBAccountSetName].ToString()); adjustSalaryHistory.AccountSet.Items = DeserializeAccountSetItems(sdr); adjustSalaryHistory.AccountSet.Description = sdr[_DBDescription].ToString(); iRet.AdjustSalaryHistoryList = new List <AdjustSalaryHistory>(); iRet.AdjustSalaryHistoryList.Add(adjustSalaryHistory); return(iRet); } } return(null); }
private AdjustSalaryHistory CreateAdjustSalaryHistory() { AdjustSalaryHistory adjustSalaryHistory = new AdjustSalaryHistory(); adjustSalaryHistory.AccountsBackName = _BackAccountsName; adjustSalaryHistory.AccountSet = _AccountSet; adjustSalaryHistory.ChangeDate = _ChangeDate; adjustSalaryHistory.Description = _Description; return(adjustSalaryHistory); }
public void UpdateAdjustSalaryHistory(int employeeID, AdjustSalaryHistory adjustSalaryHistory) { SqlCommand cmd = new SqlCommand(); cmd.Parameters.Add(_ParmEmployeeID, SqlDbType.Int).Value = employeeID; cmd.Parameters.Add(_ParmAccountSetName, SqlDbType.NVarChar, 255).Value = adjustSalaryHistory.AccountSet.AccountSetName; cmd.Parameters.Add(_ParmEmployeeAccountSetItems, SqlDbType.Image).Value = SerializeAccountSetItemList(adjustSalaryHistory.AccountSet.Items); cmd.Parameters.Add(_ParmChangeDate, SqlDbType.DateTime).Value = adjustSalaryHistory.ChangeDate; cmd.Parameters.Add(_ParmAccountsBackName, SqlDbType.NVarChar, 255).Value = adjustSalaryHistory.AccountsBackName; cmd.Parameters.Add(_ParmDescription, SqlDbType.NVarChar, 255).Value = adjustSalaryHistory.Description; cmd.Parameters.Add(_ParmPKID, SqlDbType.Int).Value = adjustSalaryHistory.AdjustSalaryHistoryID; SqlHelper.ExecuteNonQuery("UpdateAdjustSalaryHistory", cmd); }
public void InsertAdjustSalaryHistory(int employeeID, AdjustSalaryHistory adjustSalaryHistory) { int pkid; SqlCommand cmd = new SqlCommand(); cmd.Parameters.Add(_ParmEmployeeID, SqlDbType.Int).Value = employeeID; cmd.Parameters.Add(_ParmAccountSetName, SqlDbType.NVarChar, 255).Value = adjustSalaryHistory.AccountSet.AccountSetName; cmd.Parameters.Add(_ParmEmployeeAccountSetItems, SqlDbType.Image).Value = SerializeAccountSetItemList(adjustSalaryHistory.AccountSet.Items); cmd.Parameters.Add(_ParmChangeDate, SqlDbType.DateTime).Value = adjustSalaryHistory.ChangeDate; cmd.Parameters.Add(_ParmAccountsBackName, SqlDbType.NVarChar, 255).Value = adjustSalaryHistory.AccountsBackName; cmd.Parameters.Add(_ParmDescription, SqlDbType.NVarChar, 255).Value = adjustSalaryHistory.Description; cmd.Parameters.Add(_ParmPKID, SqlDbType.Int).Direction = ParameterDirection.Output; SqlHelper.ExecuteNonQueryReturnPKID("InsertAdjustSalaryHistory", cmd, out pkid); }
public List <AdjustSalaryHistory> GetAdjustSalaryHistoryByEmployeeIDAndDateTime(int employeeID, DateTime dt) { List <AdjustSalaryHistory> iRet = new List <AdjustSalaryHistory>(); SqlCommand cmd = new SqlCommand(); cmd.Parameters.Add(_ParmEmployeeID, SqlDbType.Int).Value = employeeID; cmd.Parameters.Add(_ParmChangeDate, SqlDbType.DateTime).Value = dt; using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetAdjustSalaryHistoryByEmployeeIDAndDateTime", cmd)) { while (sdr.Read()) { AdjustSalaryHistory adjustSalaryHistory = new AdjustSalaryHistory(); adjustSalaryHistory.AccountsBackName = sdr[_DBAccountsBackName].ToString(); adjustSalaryHistory.Description = sdr[_DBDescription].ToString(); adjustSalaryHistory.ChangeDate = (DateTime)sdr[_DBChangeDate]; adjustSalaryHistory.AccountSet = new AccountSet(0, sdr[_DBAccountSetName].ToString()); adjustSalaryHistory.AccountSet.Items = DeserializeAccountSetItems(sdr); iRet.Add(adjustSalaryHistory); } } return(iRet); }