private void FrmSoThuTien_Load(object sender, EventArgs e) { this.lopRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.LopHoc); this.namHocBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.NamHoc); this.cmbNam.Text = DateTime.Now.Year.ToString(); this.cmbThang.Text = DateTime.Now.Month.ToString(); }
private void initStaticData() { StaticDataFacade.Add(StaticDataKeys.TinhThanhPho, new TinhThanhPhoData(thanhPhoTableAdapter)); StaticDataFacade.Add(StaticDataKeys.PhuongXa, new PhuongXaData(phuongXaTableAdapter)); StaticDataFacade.Add(StaticDataKeys.QuanHuyen, new QuanHuyenData(quanHuyenTableAdapter)); StaticDataFacade.Add(StaticDataKeys.TruongHoc, new TruongData(truongTableAdapter)); StaticDataFacade.Add(StaticDataKeys.NamHoc, new NamHocData()); StaticDataFacade.Add(StaticDataKeys.KhoiHoc, new KhoiData(khoiTableAdapter)); StaticDataFacade.Add(StaticDataKeys.LopHoc, new LopData(lopTableAdapter)); StaticDataFacade.Add(StaticDataKeys.KhoanThu, new KhoanThuData(khoanThuTableAdapter)); StaticDataFacade.Add(StaticDataKeys.PhanLoaiChi, new PhanLoaiChi(phanLoaiChiTableAdapter)); StaticDataFacade.Add(StaticDataKeys.PhanLoaiThu, new PhanLoaiThu(phanLoaiThuTableAdapter)); StaticDataFacade.Add(StaticDataKeys.BangTinhPhi, new BangTinhPhi(bangTinhPhiTableAdapter)); StaticDataFacade.Add(StaticDataKeys.TrangThaiHS, new TrangThaiHSData()); StaticDataFacade.Add(StaticDataKeys.AdapterBangTinhPhi, this.bangTinhPhiTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterBangThuTien, this.bangThuTienTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterViewBangThuTien, this.viewBangThuTienTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterHocSinh, this.hocSinhTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterHocSinhLop, this.hocSinhLopTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterLopKhoi, this.lopKhoiTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterPhieuChi, this.phieuChiTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterPhieuThu, this.phieuThuTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterBangThuTienGenHistory, this.bangThuTienGenHistoryTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterBangThuTienKhoanThu, this.bangThuTienKhoanThuTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterUnknownColumnView, this.unknownColumnViewTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterKhoanThuHangNam, this.khoanThuHangNamTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterUser, this.userTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterPrivilege, this.privilegeTableAdapter); StaticDataFacade.Add(StaticDataKeys.AdapterUserPrivilege, this.userPrivilegeTableAdapter); }
public static Dictionary <int, QLMamNon.Dao.QLMamNonDs.HocSinhLopRow> GetHocSinhLopsByHocSinhIds(List <int> hocSinhIds, DateTime ngay) { if (ListUtil.IsEmpty(hocSinhIds)) { return(null); } HocSinhLopTableAdapter hocSinhLopTableAdapter = (HocSinhLopTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterHocSinhLop); Dictionary <int, QLMamNon.Dao.QLMamNonDs.HocSinhLopRow> hocSinhIdsToHocSinhLops = new Dictionary <int, QLMamNon.Dao.QLMamNonDs.HocSinhLopRow>(); QLMamNon.Dao.QLMamNonDs.HocSinhLopDataTable table = hocSinhLopTableAdapter.GetHocSinhLopByHocSinhIdsAndNgay(StringUtil.Join(hocSinhIds, ","), ngay); if (!ListUtil.IsEmpty(table.Rows)) { foreach (QLMamNon.Dao.QLMamNonDs.HocSinhLopRow row in table) { if (!hocSinhIdsToHocSinhLops.ContainsKey(row.HocSinhId)) { hocSinhIdsToHocSinhLops.Add(row.HocSinhId, row); } } } return(hocSinhIdsToHocSinhLops); }
private void FrmTinNhanPhuHuynh_Load(object sender, EventArgs e) { fillTxtGuide(); this.lopRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.LopHoc); this.cmbLop_EditValueChanged(sender, e); }
private void fillReportHocSinh(RptThongTinHocSinh rpt) { List <object> rows = new List <object>(this.GridViewMain.RowCount); for (int i = 0; i < this.GridViewMain.DataRowCount; i++) { object dataRow = this.GridViewMain.GetRow(this.GridViewMain.GetVisibleRowHandle(i)); rows.Add(dataRow); QLMamNon.Dao.QLMamNonDs.HocSinhRow hocSinhRow = (dataRow as DataRowView).Row as QLMamNon.Dao.QLMamNonDs.HocSinhRow; hocSinhRow.STT = i + 1; if (!hocSinhRow.IsPhuongXaIdNull()) { hocSinhRow.PhuongXa = StaticDataUtil.GetPhuongXaById(StaticDataFacade.Get(StaticDataKeys.PhuongXa) as QLMamNon.Dao.QLMamNonDs.PhuongXaDataTable, hocSinhRow.PhuongXaId); } if (!hocSinhRow.IsQuanHuyenIdNull()) { hocSinhRow.QuanHuyen = StaticDataUtil.GetQuanHuyenById(StaticDataFacade.Get(StaticDataKeys.QuanHuyen) as QLMamNon.Dao.QLMamNonDs.QuanHuyenDataTable, hocSinhRow.QuanHuyenId); } } rpt.hocSinhBindingSource.DataSource = rows; }
public void GenerateSoThuTienByHocSinhAndLopAndNgayTinh(int hocSinhId, int lopId, DateTime ngayTinh, int stt, ViewBangThuTienRow preMonthViewBangThuTien) { BangThuTienTableAdapter bangThuTienTableAdapter = (BangThuTienTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterBangThuTien); LopKhoiTableAdapter lopKhoiTableAdapter = (LopKhoiTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterLopKhoi); int sXThangTruoc = 0; long soTienSXThangTruoc = 0; int anSangThangTruoc = 0; long soTienAnSangThangTruoc = 0; long soTienAnSangThangNay = 0; int anToiThangTruoc = 0; long soTienAnToiThangTruoc = 0; long soTienAnToiThangNay = 0; long soTienNangKhieu = 0; long soTienTruyThu = 0; long soTienDieuHoa = 0; long soTienDoDung = 0; String ghiChu = ""; bangThuTienTableAdapter.Insert(hocSinhId, lopId, sXThangTruoc, soTienSXThangTruoc, anSangThangTruoc, soTienAnSangThangTruoc, soTienAnSangThangNay, soTienAnToiThangTruoc, anToiThangTruoc, soTienAnToiThangNay, soTienDoDung, soTienNangKhieu, soTienTruyThu, soTienDieuHoa, ngayTinh, stt, 0, DateTime.Now, ghiChu); int bangThuTienId = (int)bangThuTienTableAdapter.Adapter.InsertCommand.LastInsertedId; int khoiId = StaticDataUtil.GetKhoiIdByLopId(lopKhoiTableAdapter, lopId).Value; this.generateBangThuTienKhoanThu(bangThuTienId, khoiId, ngayTinh, preMonthViewBangThuTien); }
public List <ViewBangThuTienRow> EvaluateViewBangThuTienRowsForReport(List <ViewBangThuTienRow> viewBangThuTienRows, DateTime toDate) { HashSet <int> hocSinhIds = new HashSet <int>(); foreach (ViewBangThuTienRow viewBangThuTienRow in viewBangThuTienRows) { if (!hocSinhIds.Contains(viewBangThuTienRow.HocSinhId)) { hocSinhIds.Add(viewBangThuTienRow.HocSinhId); } } LoggerFacade.Info(string.Format("EvaluateViewBangThuTienRowsForReport for list HocSinhIds=[{0}]", StringUtil.JoinWithCommas(hocSinhIds.ToList()))); HocSinhLopTableAdapter hocSinhLopTableAdapter = (HocSinhLopTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterHocSinhLop); Dictionary <int, QLMamNon.Dao.QLMamNonDs.LopRow> hocSinhIdsToLopNames = StaticDataUtil.GetLopsByHocSinhIds(hocSinhIds.ToList(), toDate); HocSinhDataTable hocSinhDataTable = this.getHocSinhData(); foreach (ViewBangThuTienRow viewBangThuTienRow in viewBangThuTienRows) { viewBangThuTienRow.HoTen = StaticDataUtil.GetHocSinhFullNameByHocSinhId(hocSinhDataTable, viewBangThuTienRow.HocSinhId); if (hocSinhIdsToLopNames.ContainsKey(viewBangThuTienRow.HocSinhId)) { viewBangThuTienRow.Lop = hocSinhIdsToLopNames[viewBangThuTienRow.HocSinhId].Name; } } return(viewBangThuTienRows); }
public static Dictionary <int, QLMamNon.Dao.QLMamNonDs.LopRow> GetLopsByHocSinhIds(List <int> hocSinhIds, DateTime ngay) { Dictionary <int, QLMamNon.Dao.QLMamNonDs.HocSinhLopRow> hocSinhIdsToLopIds = GetHocSinhLopsByHocSinhIds(hocSinhIds, ngay); QLMamNon.Dao.QLMamNonDs.LopDataTable lopTable = StaticDataFacade.Get(StaticDataKeys.LopHoc) as QLMamNon.Dao.QLMamNonDs.LopDataTable; Dictionary <int, QLMamNon.Dao.QLMamNonDs.LopRow> hocSinhIdsToLopNames = new Dictionary <int, QLMamNon.Dao.QLMamNonDs.LopRow>(); if (ListUtil.IsEmpty(hocSinhIdsToLopIds)) { return(hocSinhIdsToLopNames); } foreach (KeyValuePair <int, QLMamNon.Dao.QLMamNonDs.HocSinhLopRow> pair in hocSinhIdsToLopIds) { if (pair.Value == null) { continue; } QLMamNon.Dao.QLMamNonDs.LopRow[] rows = lopTable.Select(String.Format("LopId={0}", pair.Value.LopId)) as QLMamNon.Dao.QLMamNonDs.LopRow[]; if (!ArrayUtil.IsEmpty(rows) && !hocSinhIdsToLopNames.ContainsKey(pair.Key)) { hocSinhIdsToLopNames.Add(pair.Key, rows[0]); } } return(hocSinhIdsToLopNames); }
public static string GetMaPhanLoaiChiNameByPhieuChiId(PhieuChiTableAdapter adapter, Int32 phieuChiId) { if (phieuChiId < 0) { return(CommonConstant.EMPTY); } QLMamNon.Dao.QLMamNonDs.PhieuChiDataTable phieChiTable = adapter.GetPhieuChiById(phieuChiId); if (ListUtil.IsEmpty(phieChiTable.Rows)) { return(CommonConstant.EMPTY); } QLMamNon.Dao.QLMamNonDs.PhieuChiRow phieChiRow = phieChiTable.Rows[0] as QLMamNon.Dao.QLMamNonDs.PhieuChiRow; if (phieChiRow != null) { QLMamNon.Dao.QLMamNonDs.PhanLoaiChiDataTable table = StaticDataFacade.Get(StaticDataKeys.PhanLoaiChi) as QLMamNon.Dao.QLMamNonDs.PhanLoaiChiDataTable; QLMamNon.Dao.QLMamNonDs.PhanLoaiChiRow[] rows = (QLMamNon.Dao.QLMamNonDs.PhanLoaiChiRow[])table.Select(String.Format("PhanLoaiChiId={0}", phieChiRow.PhanLoaiChiId)); if (!ArrayUtil.IsEmpty(rows)) { return(rows[0].MaPhanLoai); } } return(CommonConstant.EMPTY); }
private void gvMain_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { ColumnView view = sender as ColumnView; if (e.Column.FieldName == "GioiTinh" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle) { sbyte gioiTinh = (sbyte)view.GetListSourceRowCellValue(e.ListSourceRowIndex, "GioiTinh"); switch (gioiTinh) { case 0: e.DisplayText = "Nữ"; break; case 1: e.DisplayText = "Nam"; break; } } else if (e.Column.FieldName == "TinhThanhPhoId" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle) { object tinhId = view.GetListSourceRowCellValue(e.ListSourceRowIndex, "TinhThanhPhoId"); if (tinhId != DBNull.Value) { e.DisplayText = StaticDataUtil.GetThanhPhoById(StaticDataFacade.Get(StaticDataKeys.TinhThanhPho) as QLMamNon.Dao.QLMamNonDs.ThanhPhoDataTable, (int)tinhId); } } else if (e.Column.FieldName == "QuanHuyenId" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle) { object quanHuyenId = view.GetListSourceRowCellValue(e.ListSourceRowIndex, "QuanHuyenId"); if (quanHuyenId != DBNull.Value) { e.DisplayText = StaticDataUtil.GetQuanHuyenById(StaticDataFacade.Get(StaticDataKeys.QuanHuyen) as QLMamNon.Dao.QLMamNonDs.QuanHuyenDataTable, (int)quanHuyenId); } } else if (e.Column.FieldName == "PhuongXaId" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle) { object phuongXaId = view.GetListSourceRowCellValue(e.ListSourceRowIndex, "PhuongXaId"); if (phuongXaId != DBNull.Value) { e.DisplayText = StaticDataUtil.GetPhuongXaById(StaticDataFacade.Get(StaticDataKeys.PhuongXa) as QLMamNon.Dao.QLMamNonDs.PhuongXaDataTable, (int)phuongXaId); } } else if (e.Column.FieldName == "NgaySinh" && e.ListSourceRowIndex != DevExpress.XtraGrid.GridControl.InvalidRowHandle && e.Value != DBNull.Value) { DateTime ngaySinh = (DateTime)e.Value; if (e.Column.Caption == "Ngay") { e.DisplayText = ngaySinh.Day.ToString(); } else if (e.Column.Caption == "Thang") { e.DisplayText = ngaySinh.Month.ToString(); } else if (e.Column.Caption == "Nam") { e.DisplayText = ngaySinh.Year.ToString(); } } else if (e.Column.Caption == this.GridViewColumnSequenceName && e.ListSourceRowIndex >= 0) { e.DisplayText = String.Format("{0}", e.ListSourceRowIndex + 1); } }
private void cmbTinh_EditValueChanged(object sender, EventArgs e) { if (cmbTinh.EditValue != DBNull.Value) { QLMamNon.Dao.QLMamNonDs.QuanHuyenDataTable table = StaticDataFacade.Get(StaticDataKeys.QuanHuyen) as QLMamNon.Dao.QLMamNonDs.QuanHuyenDataTable; this.quanHuyenRowBindingSource.DataSource = table.Select(String.Format("ThanhPhoId={0}", cmbTinh.EditValue)); } }
public QLMamNon.Dao.QLMamNonDs.PhieuChiDataTable LoadPhieuChiByDateRangeWithGroupPhanLoaiChi(DateTime?fromDate, DateTime?toDate, List <int> phanLoaiChiIds) { PhieuChiTableAdapter phieuChiTableAdapter = (PhieuChiTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterPhieuChi); QLMamNon.Dao.QLMamNonDs.PhieuChiDataTable table = phieuChiTableAdapter.GetDataByByDateRangeWithGroupPhanLoaiChi(fromDate, toDate, StringUtil.JoinWithCommas(phanLoaiChiIds)); return(table); }
private void FrmPhanBoTaiSan_Load(object sender, EventArgs e) { this.gvTaiSan.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(GridViewMain_CustomDrawCell); this.gvLop.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(GridViewMain_CustomDrawCell); this.gvTaiSan.CustomColumnDisplayText += new CustomColumnDisplayTextEventHandler(gvMain_CustomColumnDisplayText); this.gvLop.CustomColumnDisplayText += new CustomColumnDisplayTextEventHandler(gvMain_CustomColumnDisplayText); this.lopRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.LopHoc); }
private void cmbQuan_EditValueChanged(object sender, EventArgs e) { if (cmbQuan.EditValue != DBNull.Value) { QLMamNon.Dao.QLMamNonDs.PhuongXaDataTable table = StaticDataFacade.Get(StaticDataKeys.PhuongXa) as QLMamNon.Dao.QLMamNonDs.PhuongXaDataTable; this.phuongXaRowBindingSource.DataSource = table.Select(String.Format("QuanHuyenId={0}", cmbQuan.EditValue)); } }
private void FrmThongTinHocSinh_Load(object sender, EventArgs e) { this.quanHuyenRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.QuanHuyen); this.lopRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.LopHoc); this.keyValuePairBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.TrangThaiHS); this.cmbThoiHoc.EditValue = 0; this.initCmbNamSinh(); this.loadThongTinHocSinh(null, null, null, null, null, null, 0); }
public void UpdatePhieuThu(PhieuThuRow phieuThuRow, DateTime ngay, long soTien, string maPhieu, string ghiChu, int?hocSinhId, int?phanLoaiThuId) { PhieuThuTableAdapter phieuThuTableAdapter = (PhieuThuTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterPhieuThu); int?origHocSinhId = phieuThuRow.IsHocSinhIdNull() ? (int?)null : phieuThuRow.HocSinhId; int?origPhanLoaiThuId = phieuThuRow.IsPhanLoaiThuIdNull() ? (int?)null : phieuThuRow.PhanLoaiThuId; phieuThuTableAdapter.Update(soTien, maPhieu, ghiChu, hocSinhId, phanLoaiThuId, ngay, DateTime.Now, phieuThuRow.PhieuThuId, phieuThuRow.SoTien, phieuThuRow.MaPhieu, origHocSinhId, origPhanLoaiThuId, phieuThuRow.Ngay, phieuThuRow.CreatedDate); }
public static string GetTruongNameByTruongId(Int32 truongId) { if (truongId > 0) { QLMamNon.Dao.QLMamNonDs.TruongDataTable truongTable = StaticDataFacade.Get(StaticDataKeys.TruongHoc) as QLMamNon.Dao.QLMamNonDs.TruongDataTable; QLMamNon.Dao.QLMamNonDs.TruongRow truongRow = truongTable.FindByTruongId(truongId); return(truongRow.Name); } return(CommonConstant.EMPTY); }
public bool IsAuthenticated() { bool isAuthenticated = false; if (StaticDataFacade.Contains(StaticDataKeys.AuthenticatedData)) { isAuthenticated = true; } return(isAuthenticated); }
public static string GetTruongByKhoiId(KhoiTruongTableAdapter khoiTruongTableAdapter, Int32 khoiId) { int?truongId = GetTruongIdByKhoiId(khoiTruongTableAdapter, khoiId); if (truongId != null) { QLMamNon.Dao.QLMamNonDs.TruongDataTable truongTable = StaticDataFacade.Get(StaticDataKeys.TruongHoc) as QLMamNon.Dao.QLMamNonDs.TruongDataTable; QLMamNon.Dao.QLMamNonDs.TruongRow truongRow = truongTable.FindByTruongId(truongId.Value); return(truongRow.Name); } return(CommonConstant.EMPTY); }
public QLMamNon.Dao.QLMamNonDs.PhieuThuDataTable LoadPhieuThuByDateRangeWithGroupPhanLoaiThu(DateTime?fromDate, DateTime?toDate, List <int> phanLoaiThuIds) { PhieuThuTableAdapter phieuThuTableAdapter = (PhieuThuTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterPhieuThu); QLMamNon.Dao.QLMamNonDs.PhieuThuDataTable table = phieuThuTableAdapter.GetDataByDateRangeWithGroupPhanLoaiThu(fromDate, toDate, StringUtil.JoinWithCommas(phanLoaiThuIds)); foreach (PhieuThuRow phieuThuRow in table) { phieuThuRow.PhanLoaiThu = StaticDataUtil.GetPhanLoaiThuById(phieuThuRow.PhanLoaiThuId); } return(table); }
private static void showCurrentForm() { String form = (String)StaticDataFacade.Get(StaticDataKeys.CurrentForm); FormShowType showType = (FormShowType)StaticDataFacade.Get(StaticDataKeys.CurrentFormShowType); if (FormShowType.Normal == showType) { FormMainFacade.ShowForm(form); } else { FormMainFacade.ShowDialog(form); } }
private void loadLopData() { QLMamNon.Dao.QLMamNonDs.LopDataTable dataTable = StaticDataFacade.Get(StaticDataKeys.LopHoc) as QLMamNon.Dao.QLMamNonDs.LopDataTable; foreach (QLMamNon.Dao.QLMamNonDs.LopRow row in dataTable) { int?khoiId = StaticDataUtil.GetKhoiIdByLopId(this.lopKhoiTableAdapter, row.LopId); if (khoiId.HasValue) { row.KhoiId = khoiId.Value; } } this.lopRowBindingSource.DataSource = dataTable; }
public static long CalculateSoTienPhi(int?khoiId, int soNgayNghiThang, long orgSoTien, int khoanThuId) { long soTien = orgSoTien; if (khoiId.HasValue) { QLMamNon.Dao.QLMamNonDs.BangTinhPhiDataTable bangTinhPhiTable = StaticDataFacade.Get(StaticDataKeys.BangTinhPhi) as QLMamNon.Dao.QLMamNonDs.BangTinhPhiDataTable; QLMamNon.Dao.QLMamNonDs.BangTinhPhiRow[] bangTinhPhiRows = bangTinhPhiTable.Select(String.Format("KhoiId={0} AND SoNgayNghiMin<={1} AND SoNgayNghiMax>={1} AND KhoanThuId={2}", khoiId.Value, soNgayNghiThang, khoanThuId)) as QLMamNon.Dao.QLMamNonDs.BangTinhPhiRow[]; if (!ArrayUtil.IsEmpty(bangTinhPhiRows)) { soTien = bangTinhPhiRows[0].SoTien; } } return(soTien); }
private void FrmXepLop_Load(object sender, EventArgs e) { this.gridView1.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(GridViewMain_CustomDrawCell); this.gridView1.CustomColumnDisplayText += new CustomColumnDisplayTextEventHandler(gvMain_CustomColumnDisplayText); this.gvDen.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(GridViewMain_CustomDrawCell); this.gvDen.CustomColumnDisplayText += new CustomColumnDisplayTextEventHandler(gvMain_CustomColumnDisplayText); this.gvDen.OptionsEditForm.CustomEditFormLayout = new UCEditFormXepLop(); this.hocSinhRowBindingSourceDi.DataSource = this.hocSinhTableAdapter.GetData(); this.namHocBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.NamHoc); this.lopRowBindingSourceDi.DataSource = StaticDataFacade.Get(StaticDataKeys.LopHoc); this.lopRowBindingSourceDen.DataSource = StaticDataFacade.Get(StaticDataKeys.LopHoc); this.cmbNamHocDi.EditValue = DateTime.Now.Year; }
private void FrmBaoCaoHoatDongTaiChinh_Load(object sender, EventArgs e) { txtConnectionString.Text = (string)Settings.Default["qlmamnonConnectionString1"]; dateAppLaunchDate.DateTime = (DateTime)Settings.Default["AppLannchDate"]; txtSoTienAnSang.Value = (long)Settings.Default["TienAnSang"]; txtSoTienAnToi.Value = (long)Settings.Default["TienAnToi"]; txtSoTienAnChinh.Value = (long)Settings.Default["TienAnChinh"]; txtSoTienTonDauKy.Value = (long)Settings.Default["SoTienTonDauKy"]; txtYearForDropDown.Value = (int)Settings.Default["StartYearForDropDown"]; txtTTHSSearchYearFrom.Value = (int)Settings.Default["NamSinhStart"]; txtThuByHS.Text = (string)Settings.Default["PhanLoaiThuByHocSinh"]; chkGiayBaoNopTienDieuHoa.Checked = (bool)Settings.Default["ShowGiayBaoNopTienDieuHoa"]; chkGiayBaoNopTienGhiChu.Checked = (bool)Settings.Default["ShowGiayBaoNopTienNote"]; phanLoaiThuRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.PhanLoaiThu); }
private void addPhieuThuToReport(SortedList soQuyTienMatMap, DateTime fromDate, DateTime toDate, List <int> phanLoaiThuIds) { PhieuThuTableAdapter phieuThuTableAdapter = (PhieuThuTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterPhieuThu); QLMamNon.Dao.QLMamNonDs.PhieuThuDataTable phieuThuDataTable = phieuThuTableAdapter.GetDataForSoQuyTienMat(fromDate, toDate, StringUtil.JoinWithCommas(phanLoaiThuIds)); Dictionary <string, SoQuyTienMatItem> groupDateToSoQuyTienMatItemsMap = new Dictionary <string, SoQuyTienMatItem>(); foreach (QLMamNon.Dao.QLMamNonDs.PhieuThuRow phieuThuRow in phieuThuDataTable) { phieuThuRow.PhanLoaiThu = phieuThuRow.IsPhanLoaiThuIdNull() ? "Thu tiền học phí" : StaticDataUtil.GetPhanLoaiThuById(phieuThuRow.PhanLoaiThuId); int groupDate = getGroupDate(fromDate, phieuThuRow); DateTime dateOfGroup = fromDate.AddDays((groupDate + 1) * NumberOfDateToGroupPhieuThu - 1); if (dateOfGroup > toDate) { dateOfGroup = toDate; } string key = StringUtil.Join(new int[] { groupDate, phieuThuRow.PhanLoaiThuId }, "~"); if (!groupDateToSoQuyTienMatItemsMap.ContainsKey(key)) { groupDateToSoQuyTienMatItemsMap.Add(key, new SoQuyTienMatItem() { DienGiai = phieuThuRow.PhanLoaiThu, NgayChungTu = dateOfGroup, SoTienThu = 0 }); } } foreach (QLMamNon.Dao.QLMamNonDs.PhieuThuRow phieuThuRow in phieuThuDataTable) { int groupDate = getGroupDate(fromDate, phieuThuRow); string key = StringUtil.Join(new int[] { groupDate, phieuThuRow.PhanLoaiThuId }, "~"); SoQuyTienMatItem soQuyTienMatItemThu = groupDateToSoQuyTienMatItemsMap[key]; soQuyTienMatItemThu.SoTienThu += phieuThuRow.SoTien; } int addedCount = 0; foreach (SoQuyTienMatItem soQuyTienMatItemThu in groupDateToSoQuyTienMatItemsMap.Values) { soQuyTienMatMap.Add(soQuyTienMatItemThu.NgayChungTu.AddMilliseconds(addedCount++), soQuyTienMatItemThu); } }
public static string GetPhanLoaiThuById(Int32 phanLoaiThuId) { if (phanLoaiThuId < 0) { return(CommonConstant.EMPTY); } QLMamNon.Dao.QLMamNonDs.PhanLoaiThuDataTable table = StaticDataFacade.Get(StaticDataKeys.PhanLoaiThu) as QLMamNon.Dao.QLMamNonDs.PhanLoaiThuDataTable; QLMamNon.Dao.QLMamNonDs.PhanLoaiThuRow[] rows = (QLMamNon.Dao.QLMamNonDs.PhanLoaiThuRow[])table.Select(String.Format("PhanLoaiThuId={0}", phanLoaiThuId)); if (!ArrayUtil.IsEmpty(rows)) { return(rows[0].DienGiai); } return(CommonConstant.EMPTY); }
public static string GetKhoanThuNameByKhoanThuId(Int32 khoanThuId) { if (khoanThuId < 0) { return(CommonConstant.EMPTY); } QLMamNon.Dao.QLMamNonDs.KhoanThuDataTable khoanThuTable = StaticDataFacade.Get(StaticDataKeys.KhoanThu) as QLMamNon.Dao.QLMamNonDs.KhoanThuDataTable; QLMamNon.Dao.QLMamNonDs.KhoanThuRow khoanThuRow = khoanThuTable.FindByKhoanThuId(khoanThuId); if (khoanThuRow != null) { return(khoanThuRow.Ten); } return(CommonConstant.EMPTY); }
public static string GetLopNameByLopId(Int32 lopId) { if (lopId < 0) { return(CommonConstant.EMPTY); } QLMamNon.Dao.QLMamNonDs.LopDataTable lopTable = StaticDataFacade.Get(StaticDataKeys.LopHoc) as QLMamNon.Dao.QLMamNonDs.LopDataTable; QLMamNon.Dao.QLMamNonDs.LopRow lopRow = lopTable.FindByLopId(lopId); if (lopRow != null) { return(lopRow.Name); } return(CommonConstant.EMPTY); }
public static string GetKhoiNameByKhoiId(Int32 khoiId) { if (khoiId < 0) { return(CommonConstant.EMPTY); } QLMamNon.Dao.QLMamNonDs.KhoiDataTable khoiTable = StaticDataFacade.Get(StaticDataKeys.KhoiHoc) as QLMamNon.Dao.QLMamNonDs.KhoiDataTable; QLMamNon.Dao.QLMamNonDs.KhoiRow khoiRow = khoiTable.FindByKhoiId(khoiId); if (khoiRow != null) { return(khoiRow.Name); } return(CommonConstant.EMPTY); }