//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 { } } }
public override void ReLoad() { base.SetWaitDialogCaption("Đang nạp dữ liệu..."); DIC_ALLOWANCE dICALLOWANCE = new DIC_ALLOWANCE(); this.gcList.DataSource = dICALLOWANCE.GetList(); base.SetWaitDialogCaption("Đang nạp cấu hình..."); this.List_Init(this.gbList); base.SetWaitDialogCaption("Nạp quyền sử dụng..."); MyRule.Get(MyLogin.RoleId, "bbiAllowance"); if (!MyRule.AllowPrint) { this.ucToolBar.bbiPrint.Visibility = BarItemVisibility.Never; } MyRule.Get(MyLogin.RoleId, "bbiAllowance"); if (!MyRule.AllowExport) { this.ucToolBar.bbiExport.Visibility = BarItemVisibility.Never; } MyRule.Get(MyLogin.RoleId, "bbiAllowance"); if (!MyRule.AllowAdd) { this.ucToolBar.bbiAdd.Visibility = BarItemVisibility.Never; } MyRule.Get(MyLogin.RoleId, "bbiAllowance"); if (!MyRule.AllowDelete) { this.ucToolBar.bbiDelete.Visibility = BarItemVisibility.Never; } MyRule.Get(MyLogin.RoleId, "bbiAllowance"); if (!MyRule.AllowEdit) { this.ucToolBar.bbiEdit.Visibility = BarItemVisibility.Never; } base.SetWaitDialogCaption("Đã xong..."); this.DoHide(); }