Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        private void FrmTinNhanPhuHuynh_Load(object sender, EventArgs e)
        {
            fillTxtGuide();

            this.lopRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.LopHoc);
            this.cmbLop_EditValueChanged(sender, e);
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 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();
 }
Exemplo n.º 9
0
        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);
            }
        }
Exemplo n.º 10
0
 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));
     }
 }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
 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);
 }
Exemplo n.º 13
0
 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));
     }
 }
Exemplo n.º 14
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);
        }
Exemplo n.º 15
0
 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);
 }
Exemplo n.º 16
0
        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);
        }
Exemplo n.º 17
0
        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);
        }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
        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);
            }
        }
Exemplo n.º 20
0
        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;
        }
Exemplo n.º 21
0
        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);
        }
Exemplo n.º 22
0
        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;
        }
Exemplo n.º 23
0
        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);
        }
Exemplo n.º 24
0
        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);
            }
        }
Exemplo n.º 25
0
        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);
        }
Exemplo n.º 26
0
        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);
        }
Exemplo n.º 27
0
        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);
        }
Exemplo n.º 28
0
        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);
        }
Exemplo n.º 29
0
        public FrmUser()
        {
            InitializeComponent();

            this.TablePrimaryKey = "UserId";
            this.DanhMuc         = DanhMucConstant.User;
            this.FormKey         = AppForms.FormUser;

            UserTableAdapter userTableAdapter = (UserTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterUser);

            this.userRowBindingSource.DataSource = userTableAdapter.GetData();

            UCEditFormUser ucEditFormUser = new UCEditFormUser();

            ucEditFormUser.GridView = this.gvMain;
            this.gvMain.OptionsEditForm.CustomEditFormLayout = ucEditFormUser;
            this.InitForm(this.btnThem, this.btnChinhSua, this.btnXoa, this.btnLuu, this.btnHuyBo, this.gvMain, userTableAdapter.Adapter, this.userRowBindingSource.DataSource as QLMamNon.Dao.QLMamNonDs.UserDataTable);
        }
Exemplo n.º 30
0
        private void FrmTaoPhieuThu_Load(object sender, EventArgs e)
        {
            HocSinhTableAdapter    hocSinhTableAdapter    = (HocSinhTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterHocSinh);
            HocSinhLopTableAdapter hocSinhLopTableAdapter = (HocSinhLopTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterHocSinhLop);

            QLMamNon.Dao.QLMamNonDs.HocSinhDataTable hocSinhTable = hocSinhTableAdapter.GetData();
            ThongTinHocSinhUtil.EvaluateLopInfoForHocSinhTable(hocSinhLopTableAdapter, hocSinhTable);
            this.hocSinhRowBindingSource.DataSource     = hocSinhTable;
            this.phanLoaiThuRowBindingSource.DataSource = StaticDataFacade.Get(StaticDataKeys.PhanLoaiThu);

            if (this.IsEditing)
            {
                this.loadPhieuThu();
            }
            else
            {
                this.resetForm();
            }
        }