public void Init(Guid SalaryTableListID, string EmployeeCode) { this.m_SalaryTableListID = SalaryTableListID; this.m_EmployeeCode = EmployeeCode; this.InitData(); this.barManager1.SetPopupContextMenu(this.gcList, this.ppMenu); this.repMoney.EditValueChanging += new ChangingEventHandler(this.repMoney_EditValueChanging); this.repMoney.EditValueChanged += new EventHandler(this.repMoney_EditValueChanged); HRM_SALARY_PLUS hRMSALARYPLU = new HRM_SALARY_PLUS(); this.gcList.DataSource = hRMSALARYPLU.GetListByEmployeeByType(this.m_SalaryTableListID, this.m_EmployeeCode, 0); }
public void Save() { HRM_SALARY_PLUS hRMSALARYPLU = new HRM_SALARY_PLUS(); hRMSALARYPLU.DeleteAll(this.m_SalaryTableListID, this.m_EmployeeCode); try { foreach (DataRow row in (this.gcList.DataSource as DataTable).Rows) { try { if (row != null) { string str = ""; try { str = (row["IncomeCode"] != null ? row["IncomeCode"].ToString() : ""); } catch { } hRMSALARYPLU.Insert(this.m_SalaryTableListID, this.m_EmployeeCode, Guid.NewGuid(), str, row["SalaryPlusName"].ToString(), 0, (row["Money"] == null ? new decimal(0) : decimal.Parse(row["Money"].ToString())), (row["PayMoney"] == null ? new decimal(0) : decimal.Parse(row["PayMoney"].ToString())), (row["DebtMoney"] == null ? new decimal(0) : decimal.Parse(row["DebtMoney"].ToString())), new decimal(0), (row["Date"] == null ? DateTime.Now : DateTime.Parse(row["Date"].ToString())), row["Description"].ToString()); } } catch { continue; } } this.UpdateEmployeeSalary(); this.RaiseSavedHander(); } catch { } }