Пример #1
0
 private void btnTimKiem_Click(object sender, EventArgs e)
 {
     SplashScreenManager.ShowForm(typeof(O2S_Common.Utilities.ThongBao.WaitForm_Wait));
     try
     {
         PhieuGhiDanhFilter _filter = new PhieuGhiDanhFilter();
         _filter.CoSoId          = GlobalSettings.CoSoId;
         _filter.NgayGhiDanh_Tu  = date_TuNgay.DateTime;
         _filter.NgayGhiDanh_Den = date_DenNgay.DateTime;
         this._lstPhieuGhiDanh   = PhieuGhiDanhLogic.Select(_filter);
         if (this._lstPhieuGhiDanh != null && this._lstPhieuGhiDanh.Count > 0)
         {
             gridControlDSPhieuGhiDanh.DataSource = this._lstPhieuGhiDanh;
         }
         else
         {
             gridControlDSPhieuGhiDanh.DataSource = null;
         }
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Error(ex);
     }
     SplashScreenManager.CloseForm();
 }
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            SplashScreenManager.ShowForm(typeof(O2S_Common.Utilities.ThongBao.WaitForm_Wait));
            try
            {
                PhieuGhiDanhFilter _filter = new PhieuGhiDanhFilter();
                _filter.CoSoId          = GlobalSettings.CoSoId;
                _filter.NgayGhiDanh_Tu  = date_TuNgay.DateTime;
                _filter.NgayGhiDanh_Den = date_DenNgay.DateTime;
                this.lstHVNoHocPhi      = PhieuGhiDanhLogic.Select(_filter).Where(o => o.ConNo > 0).ToList();

                if (this.lstHVNoHocPhi != null && this.lstHVNoHocPhi.Count > 0)
                {
                    for (int i = 0; i < this.lstHVNoHocPhi.Count; i++)
                    {
                        this.lstHVNoHocPhi[i].Stt = i + 1;
                    }
                    gridControlDSBaoCao.DataSource = this.lstHVNoHocPhi;
                }
                else
                {
                    gridControlDSBaoCao.DataSource = null;
                }
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Error(ex);
            }
            SplashScreenManager.CloseForm();
        }
        public void LoadPhieuGhiDanh()
        {
            PhieuGhiDanhFilter _filter = new PhieuGhiDanhFilter();

            _filter.CoSoId          = GlobalSettings.CoSoId;
            _filter.NgayGhiDanh_Tu  = date_TuNgay.DateTime;
            _filter.NgayGhiDanh_Den = date_DenNgay.DateTime;
            List <PhieuGhiDanh_PlusDTO> _lstPhieuGhiDanh = PhieuGhiDanhLogic.Select(_filter);

            gridControlDSPhieuGhiDanh.DataSource = _lstPhieuGhiDanh;
            lblTongCongPhieu.Text = string.Format("Tổng cộng: {0} phiếu ghi danh", gridViewDSPhieuGhiDanh.RowCount);
        }
        private void ValidateXoaHocVien(int _hocvienId)
        {
            //hv khong cho xoa: da lap phieu ghi danh
            PhieuGhiDanhFilter _filter = new PhieuGhiDanhFilter()
            {
                HocVienId = _hocvienId,
            };
            List <PhieuGhiDanh_PlusDTO> _lstphieugd = PhieuGhiDanhLogic.Select(_filter);

            if (_lstphieugd != null && _lstphieugd.Count > 0)
            {
                throw new ArgumentException("Học viên đã lập phiếu ghi danh nên không thể xóa được.");
            }
        }
        private void ValidateXoaKhoaHoc(int _KhoaHocId)
        {
            //kiem tra neu khóa học đã có trong PHIEUGHIDANH thì không cho xóa
            PhieuGhiDanhFilter _filter = new PhieuGhiDanhFilter();

            _filter.KhoaHocId = _KhoaHocId;
            _filter.CoSoId    = GlobalSettings.CoSoId;

            List <PhieuGhiDanh_PlusDTO> _lstPhieuGD = PhieuGhiDanhLogic.Select(_filter);

            if (_lstPhieuGD != null && _lstPhieuGD.Count > 0)
            {
                throw new ArgumentException("Khóa học đã được sử dụng nên không thể xóa");
            }
        }
        private void ValidateLuuPhieu()
        {
            var rowHandle = gridViewDSHocVien.FocusedRowHandle;

            PhieuGhiDanhFilter _filter = new PhieuGhiDanhFilter();

            _filter.HocVienId = O2S_Common.TypeConvert.Parse.ToInt32(gridViewDSHocVien.GetRowCellValue(rowHandle, "HocVienId").ToString());

            var f = PhieuGhiDanhLogic.Select(_filter);

            foreach (var i in f)
            {
                if (i.ConNo > 0)
                {
                    throw new Exception("Học viên đang nợ không được phép ghi danh mới");
                }
            }
            if (O2S_Common.TypeConvert.Parse.ToDecimal(numDaDong.Text) < O2S_Common.TypeConvert.Parse.ToDecimal(GlobalSettings.lstQuyDinh["QD0001"]))
            {
                throw new Exception(string.Format("Số tiền đóng khi ghi danh phải ít nhất bằng {0:C0}", GlobalSettings.lstQuyDinh["QD0001"]));
            }
        }