private void xucSalaryCard1_Updated_1(object sender) { HRM_SALARY hRMSALARY = new HRM_SALARY(); hRMSALARY.Get(this.m_SalaryTableListID, this.m_EmployeeCode); this.UpdateRow(hRMSALARY); }
private void CreateSalaryTabelList() { Options.SetWaitDialogCaption("Đang khởi tạo dữ liệu..."); if ((new HRM_TIMEKEEPER_TABLELIST()).Exist(this.m_Month, this.m_Year)) { HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST(); DIC_SALARY_FORMULA dICSALARYFORMULA = new DIC_SALARY_FORMULA(); dICSALARYFORMULA.Get(); if (!hRMSALARYTABLELIST.Exist(this.m_Month, this.m_Year)) { Guid guid = Guid.NewGuid(); if (hRMSALARYTABLELIST.Insert(guid.ToString(), string.Concat("Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString()), this.m_Month, this.m_Year, dICSALARYFORMULA.SocialInsurance, dICSALARYFORMULA.HealthInsurance, dICSALARYFORMULA.UnemploymentInsurance, dICSALARYFORMULA.SocialInsurance1, dICSALARYFORMULA.HealthInsurance1, dICSALARYFORMULA.UnemploymentInsurance1, dICSALARYFORMULA.OvertimeSaturdayType, false, false) == "OK") { HRM_SALARY_ALLOWANCE.Create(guid.ToString(), true); HRM_SALARY_INCOME.Create(guid.ToString()); HRM_SALARY.Create(0, "", guid.ToString(), string.Concat("Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString()), this.m_Month, this.m_Year); } this.RaiseCreatedHandler(); } Options.HideDialog(); } else { MessageBox.Show("Bảng chấm công tháng này chưa được khởi tạo! Vui lòng tạo bảng chấm công trước khi thực hiện tính lương!"); Options.HideDialog(); } }
private void UpdateEmployeeSalary() { HRM_TIMEKEEPER_TABLELIST hRMTIMEKEEPERTABLELIST = new HRM_TIMEKEEPER_TABLELIST(); HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST(); hRMSALARYTABLELIST.GetByID(this.m_SalaryTableListID); hRMTIMEKEEPERTABLELIST.Get(hRMSALARYTABLELIST.Month, hRMSALARYTABLELIST.Year); Guid timeKeeperTableListID = hRMTIMEKEEPERTABLELIST.TimeKeeperTableListID; HRM_SALARY.EmployeeUpdate(timeKeeperTableListID.ToString(), this.m_SalaryTableListID.ToString(), hRMSALARYTABLELIST.Month, hRMSALARYTABLELIST.Year, this.m_EmployeeCode); }
private void UpdateEmployeeSalary() { HRM_TIMEKEEPER_TABLELIST hRMTIMEKEEPERTABLELIST = new HRM_TIMEKEEPER_TABLELIST(); HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST(); hRMTIMEKEEPERTABLELIST.Get(this.m_Month, this.m_Year); hRMSALARYTABLELIST.Get(this.m_Month, this.m_Year); string str = hRMTIMEKEEPERTABLELIST.TimeKeeperTableListID.ToString(); Guid salaryTableListID = hRMSALARYTABLELIST.SalaryTableListID; HRM_SALARY.EmployeeUpdate(str, salaryTableListID.ToString(), this.m_Month, this.m_Year, this.m_EmployeeCode); }
private void UpdateIncomeRow() { HRM_SALARY_INCOME hRMSALARYINCOME = new HRM_SALARY_INCOME(); HRM_SALARY hRMSALARY = new HRM_SALARY(); foreach (DataRow row in hRMSALARYINCOME.GetList().Rows) { try { this.gbList.SetFocusedRowCellValue(string.Concat("Income", row["IncomeCode"].ToString()), hRMSALARY.GetTotalIncome(this.m_SalaryTableListID, this.m_EmployeeCode, row["IncomeCode"].ToString())); } catch { } } }
//protected override void SendMail() //{ // if (!WinInet.IsConnectedToInternet()) // { // XtraMessageBox.Show("Vui lòng kiểm tra lại kết nối với mạng internet!"); // } // else // { // SendReportMail sendReportMail = new SendReportMail(); // if (!sendReportMail.IsLoginMail()) // { // sendReportMail.LoginSuccessed += new SendReportMail.LoginSuccessHander((object s) => this.SendMail("", true)); // sendReportMail.Sended += new SendReportMail.SendHander((object s, string content, bool attach) => this.SendMail(content, attach)); // sendReportMail.LoginMail(2); // return; // } // if ((new clsAllOption()).ShowSendMail) // { // xfmMailContent _xfmMailContent = new xfmMailContent(2); // _xfmMailContent.Sended += new xfmMailContent.SendHander((object s, string content, bool attach) => { // _xfmMailContent.Close(); // this.SendMail(content, attach); // }); // _xfmMailContent.ShowDialog(); // } // else // { // this.SendMail("", true); // } // } //} //private void SendMail(string Content, bool Attach) //{ // if (Content == "") // { // Content = this.LoadMailContent(); // } // HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE(); // int[] selectedRows = this.gbList.GetSelectedRows(); // int length = (int)selectedRows.Length; // while (length > 0) // { // string str = this.gbList.GetRowCellValue(selectedRows[length - 1], "EmployeeCode").ToString(); // hRMEMPLOYEE.Get(str); // if (!(hRMEMPLOYEE.Email == "")) // { // clsOptionPrintSalary _clsOptionPrintSalary = new clsOptionPrintSalary(); // XtraReport xtraReport = new XtraReport(); // if (_clsOptionPrintSalary.Theme == 0) // { // xtraReport = new rptSalary(this.m_Month, this.m_Year, str); // } // else if (_clsOptionPrintSalary.Theme != 1) // { // xtraReport = new rptSalary3(this.m_Month, this.m_Year, str); // } // else // { // xtraReport = new rptSalary2(this.m_Month, this.m_Year, str); // } // SendReportMail sendReportMail = new SendReportMail(); // string str1 = ""; // str1 = (!hRMEMPLOYEE.Sex ? "Chị" : "Anh"); // string str2 = Content.Replace("[Mã nhân viên]", str); // str2 = str2.Replace("[Họ lót]", hRMEMPLOYEE.FirstName); // str2 = str2.Replace("[Tên]", hRMEMPLOYEE.LastName); // string[] strArrays = new string[5]; // int birthdayDay = hRMEMPLOYEE.BirthdayDay; // strArrays[0] = birthdayDay.ToString(); // strArrays[1] = "/"; // birthdayDay = hRMEMPLOYEE.BirthdayMonth; // strArrays[2] = birthdayDay.ToString(); // strArrays[3] = "/"; // birthdayDay = hRMEMPLOYEE.BirthdayYear; // strArrays[4] = birthdayDay.ToString(); // str2 = str2.Replace("[Ngày sinh]", string.Concat(strArrays)); // str2 = str2.Replace("[Giới tính]", str1); // str2 = str2.Replace("[Nơi sinh]", hRMEMPLOYEE.BirthPlace); // str2 = str2.Replace("[Địa chỉ]", hRMEMPLOYEE.MainAddress); // str2 = str2.Replace("[Tạm trú]", hRMEMPLOYEE.ContactAddress); // str2 = str2.Replace("[CMND]", hRMEMPLOYEE.IDCard); // str2 = str2.Replace("[Email]", hRMEMPLOYEE.Email); // str2 = str2.Replace("[Điện thoại]", hRMEMPLOYEE.CellPhone); // str2 = str2.Replace("[Chức vụ]", hRMEMPLOYEE.Position); // str2 = str2.Replace("[Chi nhánh]", hRMEMPLOYEE.BranchName); // str2 = str2.Replace("[Phòng ban]", hRMEMPLOYEE.DepartmentName); // str2 = str2.Replace("[Tổ nhóm]", hRMEMPLOYEE.GroupName); // decimal basicSalary = hRMEMPLOYEE.BasicSalary; // str2 = str2.Replace("[Lương căn bản]", basicSalary.ToString("#,0")); // str2 = str2.Replace("[Tháng]", this.m_Month.ToString()); // str2 = str2.Replace("[Năm]", this.m_Year.ToString()); // str2 = str2.Replace("[Xuống dòng]", "<br/>"); // sendReportMail.Send(hRMEMPLOYEE.Email, string.Concat(MyLogin.Account, " - ", MyInfo.Company), string.Concat("Phiếu Lương Tháng ", this.m_Month.ToString(), "/", this.m_Year.ToString()), str2, xtraReport, string.Concat(hRMEMPLOYEE.EmployeeCode, "_", this.m_Month.ToString(), this.m_Year.ToString()), Attach); // length--; // } // else // { // XtraMessageBox.Show("Chưa thiết lập địa chỉ email cho nhân viên này!"); // break; // } // } //} private void UpdateAllowanceRow() { DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE(); HRM_SALARY hRMSALARY = new HRM_SALARY(); foreach (DataRow row in dICALLOWANCE.GetList().Rows) { try { this.gbList.SetFocusedRowCellValue(row["AllowanceCode"].ToString(), hRMSALARY.GetTotalAllowance(this.m_SalaryTableListID, this.m_EmployeeCode, row["AllowanceCode"].ToString(), false)); this.gbList.SetFocusedRowCellValue(string.Concat("Tax", row["AllowanceCode"].ToString()), hRMSALARY.GetTotalAllowance(this.m_SalaryTableListID, this.m_EmployeeCode, row["AllowanceCode"].ToString(), true)); } catch { } } }
protected override void ReCreate() { base.ReCreate(); Options.SetWaitDialogCaption("Đang tính lại lương..."); HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST(); DIC_SALARY_FORMULA dICSALARYFORMULA = new DIC_SALARY_FORMULA(); dICSALARYFORMULA.Get(); hRMSALARYTABLELIST.Update(this.m_SalaryTableListID.ToString(), this.bbeName.EditValue.ToString(), this.m_Month, this.m_Year, dICSALARYFORMULA.SocialInsurance, dICSALARYFORMULA.HealthInsurance, dICSALARYFORMULA.UnemploymentInsurance, dICSALARYFORMULA.SocialInsurance1, dICSALARYFORMULA.HealthInsurance1, dICSALARYFORMULA.UnemploymentInsurance1, dICSALARYFORMULA.OvertimeSaturdayType, false, false); clsSalaryOption _clsSalaryOption = new clsSalaryOption(); HRM_SALARY_ALLOWANCE.Create(this.m_SalaryTableListID.ToString(), _clsSalaryOption.IsAllowanceReCreate); HRM_SALARY_INCOME.Create(this.m_SalaryTableListID.ToString()); HRM_SALARY.Create(this.m_Level, this.m_Code, this.m_SalaryTableListID.ToString(), this.bbeName.EditValue.ToString(), this.m_Month, this.m_Year); this.LoadGrid(); Options.HideDialog(); }
private void UpdateRow(HRM_SALARY Item) { this.gbList.SetFocusedRowCellValue(this.colCoefficientSalary, Item.CoefficientSalary); this.gbList.SetFocusedRowCellValue(this.colBasicSalary, Item.BasicSalary); this.gbList.SetFocusedRowCellValue(this.colInsuranceSalary, Item.InsuranceSalary); this.gbList.SetFocusedRowCellValue(this.colAllowanceInsurance, Item.AllowanceInsurance); this.gbList.SetFocusedRowCellValue(this.colAllowance, Item.Allowance); this.gbList.SetFocusedRowCellValue(this.colTotalSalary, Item.TotalSalary); this.gbList.SetFocusedRowCellValue(this.colAssignment, Item.Assignment); this.gbList.SetFocusedRowCellValue(this.colAssignmentPay, Item.AssignmentPay); this.gbList.SetFocusedRowCellValue(this.colAssignmentDebt, Item.AssignmentDebt); this.gbList.SetFocusedRowCellValue(this.colStipulatedTime, Item.StipulatedTime); this.gbList.SetFocusedRowCellValue(this.colWorkHour, Item.WorkHour); this.gbList.SetFocusedRowCellValue(this.colLateEarlyHour, Item.LateEarlyHour); this.gbList.SetFocusedRowCellValue(this.colMinusLateEarly, Item.MinusLateEarly); this.gbList.SetFocusedRowCellValue(this.colMinusMoney, Item.MinusMoney); this.gbList.SetFocusedRowCellValue(this.colWorkSalary, Item.WorkSalary); this.gbList.SetFocusedRowCellValue(this.colSocialInsurance, Item.SocialInsurance); this.gbList.SetFocusedRowCellValue(this.colHealthInsurance, Item.HealthInsurance); this.gbList.SetFocusedRowCellValue(this.colUnemploymentInsurance, Item.UnemploymentInsurance); this.gbList.SetFocusedRowCellValue(this.colInsurance, Item.Insurance); this.gbList.SetFocusedRowCellValue(this.colSalaryPlusBefore, Item.SalaryPlusBefore); this.gbList.SetFocusedRowCellValue(this.colSalaryMinusBefore, Item.SalaryMinusBefore); this.gbList.SetFocusedRowCellValue(this.colWorkSalary1, Item.WorkSalary1); this.gbList.SetFocusedRowCellValue(this.colIncomeTax, Item.IncomeTax); this.gbList.SetFocusedRowCellValue(this.colNumberDepend, Item.NumberDepend); this.gbList.SetFocusedRowCellValue(this.colDependMoney, Item.DependMoney); this.gbList.SetFocusedRowCellValue(this.colIncomeTaxRemain, Item.IncomeTaxRemain); this.gbList.SetFocusedRowCellValue(this.colIncomeTaxMoney, Item.IncomeTaxMoney); this.gbList.SetFocusedRowCellValue(this.colRemainSalary, Item.RemainSalary); this.gbList.SetFocusedRowCellValue(this.colAdvance, Item.Advance); this.gbList.SetFocusedRowCellValue(this.colUnion, Item.Union); this.gbList.SetFocusedRowCellValue(this.colUnion1, Item.Union1); this.gbList.SetFocusedRowCellValue(this.colSalaryPlus, Item.SalaryPlus); this.gbList.SetFocusedRowCellValue(this.colSalaryPlusPay, Item.SalaryPlusPay); this.gbList.SetFocusedRowCellValue(this.colSalaryMinus, Item.SalaryMinus); this.gbList.SetFocusedRowCellValue(this.colSalary, Item.Salary); this.gbList.SetFocusedRowCellValue(this.colSalaryPay, Item.SalaryPay); this.gbList.SetFocusedRowCellValue(this.colSalaryDebt, Item.SalaryDebt); this.UpdateAllowanceRow(); this.UpdateIncomeRow(); }
protected override void LoadGrid() { try { base.LoadGrid(); this.bbeName.EditValue = string.Concat("Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString()); this.lbSalaryName.Text = string.Concat("Bảng Tính Lương Tháng ", this.m_Month.ToString(), " - ", this.m_Year.ToString()); HRM_SALARY hRMSALARY = new HRM_SALARY(); this.gcList.DataSource = hRMSALARY.GetList(this.m_Level, this.m_Code, this.m_SalaryTableListID); HRM_SALARY_TABLELIST hRMSALARYTABLELIST = new HRM_SALARY_TABLELIST(); hRMSALARYTABLELIST.Get(this.m_Month, this.m_Year); BandedGridColumn bandedGridColumn = this.colSocialInsurance; double socialInsurance = hRMSALARYTABLELIST.SocialInsurance; bandedGridColumn.Caption = string.Concat("BHXH (", socialInsurance.ToString(), "%)"); BandedGridColumn bandedGridColumn1 = this.colHealthInsurance; socialInsurance = hRMSALARYTABLELIST.HealthInsurance; bandedGridColumn1.Caption = string.Concat("BHYT (", socialInsurance.ToString(), "%)"); BandedGridColumn bandedGridColumn2 = this.colUnemploymentInsurance; socialInsurance = hRMSALARYTABLELIST.UnemploymentInsurance; bandedGridColumn2.Caption = string.Concat("BHTN (", socialInsurance.ToString(), "%)"); BandedGridColumn bandedGridColumn3 = this.colInsurance; socialInsurance = hRMSALARYTABLELIST.SocialInsurance + hRMSALARYTABLELIST.HealthInsurance + hRMSALARYTABLELIST.UnemploymentInsurance; bandedGridColumn3.Caption = string.Concat("BHXH, BHYT, BHTN (", socialInsurance.ToString(), "%)"); BandedGridColumn bandedGridColumn4 = this.colSocialInsurance1; socialInsurance = hRMSALARYTABLELIST.SocialInsurance1; bandedGridColumn4.Caption = string.Concat("BHXH (", socialInsurance.ToString(), "%)"); BandedGridColumn bandedGridColumn5 = this.colHealthInsurance1; socialInsurance = hRMSALARYTABLELIST.HealthInsurance1; bandedGridColumn5.Caption = string.Concat("BHYT (", socialInsurance.ToString(), "%)"); BandedGridColumn bandedGridColumn6 = this.colUnemploymentInsurance1; socialInsurance = hRMSALARYTABLELIST.UnemploymentInsurance1; bandedGridColumn6.Caption = string.Concat("BHTN (", socialInsurance.ToString(), "%)"); BandedGridColumn bandedGridColumn7 = this.colInsurance1; socialInsurance = hRMSALARYTABLELIST.SocialInsurance1 + hRMSALARYTABLELIST.HealthInsurance1 + hRMSALARYTABLELIST.UnemploymentInsurance1; bandedGridColumn7.Caption = string.Concat("BHXH, BHYT, BHTN (", socialInsurance.ToString(), "%)"); } catch { } this.InitTimeKeeperColumn(); this.InitSalaryPlusMinus(); }
//private void SendMail(string Content, bool Attach) //{ // if (Content == "") // { // Content = this.LoadMailContent(); // } // if (!(this.l_Employee.Email == "")) // { // clsOptionPrintSalary _clsOptionPrintSalary = new clsOptionPrintSalary(); // XtraReport xtraReport = new XtraReport(); // if (_clsOptionPrintSalary.Theme == 0) // { // xtraReport = new rptSalary(this.m_Month, this.m_Year, this.m_EmployeeCode); // } // else if (_clsOptionPrintSalary.Theme != 1) // { // xtraReport = new rptSalary3(this.m_Month, this.m_Year, this.m_EmployeeCode); // } // else // { // xtraReport = new rptSalary2(this.m_Month, this.m_Year, this.m_EmployeeCode); // } // SendReportMail sendReportMail = new SendReportMail(); // string str = ""; // str = (!this.l_Employee.Sex ? "Chị" : "Anh"); // string str1 = Content.Replace("[Mã nhân viên]", this.m_EmployeeCode); // str1 = str1.Replace("[Họ lót]", this.l_Employee.FirstName); // str1 = str1.Replace("[Tên]", this.l_Employee.LastName); // string[] strArrays = new string[5]; // int birthdayDay = this.l_Employee.BirthdayDay; // strArrays[0] = birthdayDay.ToString(); // strArrays[1] = "/"; // birthdayDay = this.l_Employee.BirthdayMonth; // strArrays[2] = birthdayDay.ToString(); // strArrays[3] = "/"; // birthdayDay = this.l_Employee.BirthdayYear; // strArrays[4] = birthdayDay.ToString(); // str1 = str1.Replace("[Ngày sinh]", string.Concat(strArrays)); // str1 = str1.Replace("[Giới tính]", str); // str1 = str1.Replace("[Nơi sinh]", this.l_Employee.BirthPlace); // str1 = str1.Replace("[Địa chỉ]", this.l_Employee.MainAddress); // str1 = str1.Replace("[Tạm trú]", this.l_Employee.ContactAddress); // str1 = str1.Replace("[CMND]", this.l_Employee.IDCard); // str1 = str1.Replace("[Email]", this.l_Employee.Email); // str1 = str1.Replace("[Điện thoại]", this.l_Employee.CellPhone); // str1 = str1.Replace("[Chức vụ]", this.l_Employee.Position); // str1 = str1.Replace("[Chi nhánh]", this.l_Employee.BranchName); // str1 = str1.Replace("[Phòng ban]", this.l_Employee.DepartmentName); // str1 = str1.Replace("[Tổ nhóm]", this.l_Employee.GroupName); // decimal basicSalary = this.l_Employee.BasicSalary; // str1 = str1.Replace("[Lương căn bản]", basicSalary.ToString("#,0")); // str1 = str1.Replace("[Tháng]", this.m_Month.ToString()); // str1 = str1.Replace("[Năm]", this.m_Year.ToString()); // str1 = str1.Replace("[Xuống dòng]", "<br/>"); // sendReportMail.Send(this.l_Employee.Email, string.Concat(MyLogin.Account, " - ", MyInfo.Company), string.Concat("Phiếu Lương Tháng ", this.m_Month.ToString(), "/", this.m_Year.ToString()), str1, xtraReport, string.Concat(this.l_Employee.EmployeeCode, "_", this.m_Month.ToString(), this.m_Year.ToString()), Attach); // } // else // { // XtraMessageBox.Show("Chưa thiết lập địa chỉ email cho nhân viên này!"); // } //} public void SetData(Guid SalaryTableListID, string EmployeeCode, int Month, int Year) { this.m_SalaryTableListID = SalaryTableListID; this.m_EmployeeCode = EmployeeCode; this.m_Month = Month; this.m_Year = Year; this.l_Employee.Get(this.m_EmployeeCode); TextEdit textEdit = this.txtID; string employeeCode = this.l_Employee.EmployeeCode; string str = employeeCode; this.m_EmployeeCode = employeeCode; textEdit.Text = str; this.txtName.Text = string.Concat(this.l_Employee.FirstName.ToString(), " ", this.l_Employee.LastName.ToString()); this.imgPhoto.Image = this.l_Employee.Photo; HRM_SALARY hRMSALARY = new HRM_SALARY(); hRMSALARY.Get(SalaryTableListID, EmployeeCode); this.calCoefficientSalary.EditValue = hRMSALARY.CoefficientSalary; this.calBasicSalary.EditValue = hRMSALARY.BasicSalary; this.txtWorkHour.Text = hRMSALARY.WorkHour.ToString(); this.calMinusMoney.EditValue = hRMSALARY.MinusLateEarly + hRMSALARY.MinusMoney; this.calAllowance.EditValue = hRMSALARY.Allowance; this.calWorkSalary.EditValue = hRMSALARY.WorkSalary; this.calSocialInsurance.EditValue = hRMSALARY.SocialInsurance; this.calHealthInsurance.EditValue = hRMSALARY.HealthInsurance; this.calUnemploymentInsurance.EditValue = hRMSALARY.UnemploymentInsurance; this.calAdvance.EditValue = hRMSALARY.Advance; this.calIncomeTaxMoney.EditValue = hRMSALARY.IncomeTaxMoney; this.calSalary.EditValue = hRMSALARY.Salary; this.calSalaryPay.EditValue = hRMSALARY.SalaryPay; this.calSalaryDebt.EditValue = hRMSALARY.SalaryDebt; if (this.xucSalaryAllowanceByEmployee != null) { this.xucSalaryAllowanceByEmployee.Init(this.m_SalaryTableListID, this.m_EmployeeCode); } if (this.xucAdvance != null) { this.xucAdvance.Init(this.m_EmployeeCode, this.m_Month, this.m_Year); } if (this.xucSalaryPayByEmployee != null) { this.xucSalaryPayByEmployee.Init(this.m_SalaryTableListID, this.m_EmployeeCode); } if (this.xucSalaryDebitByEmployee != null) { this.xucSalaryDebitByEmployee.Init(this.m_SalaryTableListID, this.m_EmployeeCode); } if (this.xucAssignment != null) { this.xucAssignment.Init(this.m_EmployeeCode, this.m_Month, this.m_Year); } if (this.xucSalaryMinus != null) { this.xucSalaryMinus.Init(this.m_SalaryTableListID, this.m_EmployeeCode); } if (this.xucSalaryPlus != null) { this.xucSalaryPlus.Init(this.m_SalaryTableListID, this.m_EmployeeCode); } }