public void BindData(ReportFilterQuyetDinhLuong filter) { try { DataTable table = DataController.DataHandler.GetInstance().ExecuteDataTable("WG_GetQuyetDinhLuong", "@IdQuyetDinhLuong", filter.ID); if (table.Rows.Count > 0) { string hoTen = table.Rows[0]["HO_TEN"].ToString(); string chucVu = table.Rows[0]["TEN_CHUCVU"].ToString(); ReportController rpController = new ReportController(); // Số : {0} xrRichText21.Rtf = rpController.Convertstringtortf(xrRichText21.Rtf, "{0}", table.Rows[0]["SoQuyetDinh"].ToString()); // Hà nội, ngày {0} tháng {1} năm {2} xrRichText5.Rtf = rpController.Convertstringtortf(xrRichText5.Rtf, "{0}", DateTime.Now.ToString("dd")); xrRichText5.Rtf = rpController.Convertstringtortf(xrRichText5.Rtf, "{1}", DateTime.Now.ToString("MM")); xrRichText5.Rtf = rpController.Convertstringtortf(xrRichText5.Rtf, "{2}", DateTime.Now.ToString("yyyy")); // về việc phụ cấp kiêm nhiệm xrRichText7.Rtf = rpController.Convertstringtortf(xrRichText7.Rtf, "{0}", hoTen); // Phòng {0} {1} thuộc CT CPTGGT) xrRichText8.Rtf = rpController.Convertstringtortf(xrRichText8.Rtf, "{0}", table.Rows[0]["TEN_DONVI"].ToString()); xrRichText8.Rtf = rpController.Convertstringtortf(xrRichText8.Rtf, "{1}", table.Rows[0]["TenChiNhanh"].ToString()); // Căn cứ vào sự nỗ lực và cố gắng của {0} - {1} trong thời gian qua xrRichText11.Rtf = rpController.Convertstringtortf(xrRichText11.Rtf, "{0}", chucVu); xrRichText11.Rtf = rpController.Convertstringtortf(xrRichText11.Rtf, "{1}", hoTen); // a. Phụ cấp kiêm nhiệm đối với {0} {1} - {2} thuộc Công ty CPTGGT kể từ ngày {3}: xrRichText14.Rtf = rpController.Convertstringtortf(xrRichText14.Rtf, "{0}", chucVu.Trim()); xrRichText14.Rtf = rpController.Convertstringtortf(xrRichText14.Rtf, "{1}", hoTen); xrRichText14.Rtf = rpController.Convertstringtortf(xrRichText14.Rtf, "{2}", table.Rows[0]["TEN_DONVI"].ToString()); xrRichText14.Rtf = rpController.Convertstringtortf(xrRichText14.Rtf, "{3}", table.Rows[0]["NgayApDungPhuCap"].ToString().Remove(10)); // thông tin lương, phụ cấp DataSource = table; xrtHoTen.DataBindings.Add("Text", DataSource, "HO_TEN"); xrtMucLuong.DataBindings.Add("Text", DataSource, "LuongCung", "{0:n0}"); xrtMucPhuCap.DataBindings.Add("Text", DataSource, "MucPhuCap", "{0:n0}"); xrtTongThuNhap.DataBindings.Add("Text", DataSource, "TongThuNhap", "{0:n0}"); // Điều 2. {0}, Phòng HCNS và nhân viên {1} chịu trách nhiệm thi hành quyết định này. xrRichText17.Rtf = rpController.Convertstringtortf(xrRichText17.Rtf, "{1}", hoTen); // Quyết định này có hiệu lực kể từ ngày {0} ./. xrRichText18.Rtf = rpController.Convertstringtortf(xrRichText18.Rtf, "{0}", table.Rows[0]["NgayHieuLuc"].ToString().Remove(10)); // Footer if (!string.IsNullOrEmpty(filter.TenNguoiKy)) { xrtNguoiKy.Text = filter.TenNguoiKy; } } else { ExtMessage.Dialog.Alert("Không có dữ liệu"); } } catch (Exception ex) { ExtMessage.Dialog.Alert("Có lỗi xảy ra: " + ex.Message); } }
public void BindData(ReportFilterQuyetDinhLuong filter) { // get salary dicision by prkeyHoSo string tenTP = new HeThongController().GetValueByName(SystemConfigParameter.CITY, filter.MaDonVi); string tenDV = new DM_DONVIController().GetNameById(filter.MaDonVi); xrt_ngayketxuat.Text = tenTP + ", ngày " + DateTime.Now.Day + " tháng " + DateTime.Now.Month + " năm " + DateTime.Now.Year; DataTable salaryDecision = DataController.DataHandler.GetInstance().ExecuteDataTable("sp_GetSalaryDecisionByID", "@ID", filter.ID); double totalSalary = 0; if (salaryDecision.Rows.Count > 0) { xrlSoQuyetDinh.Text = "Số: " + salaryDecision.Rows[0]["SoQuyetDinh"]; xrlTitle.Text = xrlTitle.Text.Replace("{1}", salaryDecision.Rows[0]["HO_TEN"].ToString()); xrlTitle.Text = xrlTitle.Text.Replace("{2}", salaryDecision.Rows[0]["MA_CB"].ToString()); xrlCanCu.Text = xrlCanCu.Text.Replace("{3}", tenDV); xrlXepLuongVoi.Text = xrlXepLuongVoi.Text.Replace("{4}", salaryDecision.Rows[0]["HO_TEN"].ToString()); xrlChucDanh.Text = salaryDecision.Rows[0]["TEN_CHUCVU"].ToString(); xrlPhongBan.Text = xrlPhongBan.Text.Replace("{7}", salaryDecision.Rows[0]["TEN_DONVI"].ToString()); xrlNgach.Text = salaryDecision.Rows[0]["TEN_NGACH"].ToString(); xrlBacLuong.Text = salaryDecision.Rows[0]["BacLuong"].ToString(); xrlHeSoLuong.Text = salaryDecision.Rows[0]["HeSoLuong"].ToString(); if (!Convert.IsDBNull(salaryDecision.Rows[0]["LuongCung"])) { double tmp = Convert.ToDouble(salaryDecision.Rows[0]["LuongCung"]); if (tmp > 0) { totalSalary += tmp; } xrlMucLuong.Text = Convert.ToDecimal(salaryDecision.Rows[0]["LuongCung"]).ToString("n0") + " VND"; } else { xrlMucLuong.Text = ""; } if (!Convert.IsDBNull(salaryDecision.Rows[0]["LuongDongBHXH"])) { double tmp = Convert.ToDouble(salaryDecision.Rows[0]["LuongDongBHXH"]); if (tmp > 0) { totalSalary -= tmp; } xrlLuongDongBH.Text = Convert.ToDecimal(salaryDecision.Rows[0]["LuongDongBHXH"]).ToString("n0") + " VND"; } else { xrlLuongDongBH.Text = ""; } xrlBacLuongNB.Text = salaryDecision.Rows[0]["BacLuongNB"].ToString(); xrNoiDungQD.Text = xrNoiDungQD.Text.Replace("{14}", tenDV); string ngayHL = salaryDecision.Rows[0]["NgayHieuLuc"].ToString(); if (!string.IsNullOrEmpty(ngayHL)) { xrNoiDungQD.Text = xrNoiDungQD.Text.Replace("{15}", string.Format("{0:dd/MM/yyyy}", DateTime.Parse(ngayHL))); } else { xrNoiDungQD.Text = xrNoiDungQD.Text.Replace("{15}", "....."); } string ngayHLNB = salaryDecision.Rows[0]["NgayHuongLuongNB"].ToString(); if (!string.IsNullOrEmpty(ngayHLNB)) { xrNoiDungQD.Text = xrNoiDungQD.Text.Replace("{16}", string.Format("{0:dd/MM/yyyy}", DateTime.Parse(ngayHLNB))); } else { xrNoiDungQD.Text = xrNoiDungQD.Text.Replace("{16}", "....."); } xrNoiDungQD.Text = xrNoiDungQD.Text.Replace("{18}", salaryDecision.Rows[0]["HO_TEN"].ToString()); xrlNoiNhan.Text = xrlNoiNhan.Text.Replace("{19}", salaryDecision.Rows[0]["HO_TEN"].ToString()); } DataTable phucapInformation = DataController.DataHandler.GetInstance().ExecuteDataTable("sp_GetPhuCapByPrkeyHoSoLuong", "@PrkeyHoSoLuong", filter.ID); foreach (DataRow item in phucapInformation.Rows) { if (!Convert.IsDBNull(item["SoTien"])) { double tmp = Convert.ToDouble(item["SoTien"]); if (tmp > 0) { totalSalary += tmp; } } } xrlThuNhapGop.Text = xrlThuNhapGop.Text.Replace("{8}", string.Format("{0:n0} VND", totalSalary)); DataSource = phucapInformation; xrt_tenphucap.DataBindings.Add("Text", DataSource, "Ten", "+ {0}"); xrt_tien.DataBindings.Add("Text", DataSource, "SoTien", "{0:n0} VND"); }