示例#1
0
        public static List <KhoaHoc_PlusDTO> Select(KhoaHocFilter _filter)
        {
            try
            {
                var query = (from p in GlobalSettings.Database.KHOAHOCs
                             select p).AsEnumerable().Select((obj, index) => new KhoaHoc_PlusDTO
                {
                    Stt             = index + 1,
                    KhoaHocId       = obj.KhoaHocId,
                    CoSoId          = obj.CoSoId,
                    TenCoSoTrungTam = obj.COSOTRUNGTAM.TenCoSo,
                    MaKhoaHoc       = obj.MaKhoaHoc,
                    TenKhoaHoc      = obj.TenKhoaHoc,
                    HocPhi          = obj.HocPhi,
                    SoTietHoc       = obj.SoTietHoc,
                    HocPhi1TietHoc  = obj.SoTietHoc != 0?((obj.HocPhi ?? 0) / (obj.SoTietHoc ?? 0)):0,
                    IsLock          = obj.IsLock,
                    IsRemove        = obj.IsRemove,
                    TrangThai_Ten   = obj.IsRemove == 1 ? "Đã khóa" : "",
                    CreatedDate     = obj.CreatedDate,
                    CreatedBy       = obj.CreatedBy,
                    CreatedLog      = obj.CreatedLog,
                    ModifiedDate    = obj.ModifiedDate,
                    ModifiedBy      = obj.ModifiedBy,
                    ModifiedLog     = obj.ModifiedLog,
                });
                if (_filter.KhoaHocId != null && _filter.KhoaHocId != 0)
                {
                    query = query.Where(o => o.KhoaHocId == _filter.KhoaHocId).ToList();
                }
                if (_filter.CoSoId != null && _filter.CoSoId != 0)
                {
                    query = query.Where(o => o.CoSoId == _filter.CoSoId).ToList();
                }
                if (_filter.IsRemove != null && _filter.IsRemove != 0)
                {
                    query = query.Where(o => o.IsRemove == _filter.IsRemove).ToList();
                }
                if (_filter.CreatedDate_Tu != null && _filter.CreatedDate_Den != null)
                {
                    query = query.Where(o => o.CreatedDate >= _filter.CreatedDate_Tu && o.CreatedDate <= _filter.CreatedDate_Den).ToList();
                }
                return(query.ToList());
            }
            catch (System.Exception ex)
            {
                return(null);

                O2S_Common.Logging.LogSystem.Error(ex);
            }
        }
        private void frmCacLopDaHoc_Load(object sender, EventArgs e)
        {
            dateTuNgay.MaxDate = dateDenNgay.MaxDate = DateTime.Now;
            KhoaHocFilter _filter = new KhoaHocFilter();

            _filter.CoSoId           = GlobalSettings.CoSoId;
            cboKhoaHoc.DataSource    = KhoaHocLogic.Select(_filter);
            cboKhoaHoc.DisplayMember = "TenKhoaHoc";
            cboKhoaHoc.ValueMember   = "KhoaHocId";

            gridLop.AutoGenerateColumns = false;

            btnDatLai_Click(sender, e);
            btnXemTatCa_Click(sender, e);
        }
 private void LoadKhoaHoc()
 {
     try
     {
         KhoaHocFilter _filter = new KhoaHocFilter();
         _filter.CoSoId           = GlobalSettings.CoSoId;
         cboKhoaHoc.DataSource    = KhoaHocLogic.Select(_filter);
         cboKhoaHoc.DisplayMember = "TenKhoaHoc";
         cboKhoaHoc.ValueMember   = "KhoaHocId";
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Warn(ex);
     }
 }
 public void LoadGridKhoaHoc()
 {
     try
     {
         KhoaHocFilter _filter = new KhoaHocFilter();
         _filter.CoSoId                = GlobalSettings.CoSoId;
         _filter.CreatedDate_Tu        = date_TuNgay.DateTime;
         _filter.CreatedDate_Den       = date_DenNgay.DateTime;
         gridControlKhoaHoc.DataSource = KhoaHocLogic.Select(_filter);
         lblTongCong.Text              = string.Format("Tổng cộng: {0} khóa học", gridViewKhoaHoc.RowCount);
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Warn(ex);
     }
 }
示例#5
0
        private void frmHocPhiHocVien_Load(object sender, EventArgs e)
        {
            dateTuNgay.MaxDate = dateDenNgay.MaxDate = DateTime.ParseExact(DateTime.Now.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);

            btnDatLai_Click(sender, e);

            gridLop.AutoGenerateColumns = false;
            KhoaHocFilter _filter = new KhoaHocFilter();

            _filter.CoSoId           = GlobalSettings.CoSoId;
            cboKhoaHoc.DataSource    = KhoaHocLogic.Select(_filter);
            cboKhoaHoc.DisplayMember = "TenKhoaHoc";
            cboKhoaHoc.ValueMember   = "MaKhoaHoc";

            btnXemTatCa_Click(sender, e);
        }
        private void frmXemCacLopDay_Load(object sender, EventArgs e)
        {
            dateTuNgay.MaxDate = dateDenNgay.MaxDate = DateTime.ParseExact(DateTime.Now.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);

            //load khóa học
            KhoaHocFilter _filter = new KhoaHocFilter();

            _filter.CoSoId = GlobalSettings.CoSoId;

            cboKhoaHoc.DataSource    = KhoaHocLogic.Select(_filter);
            cboKhoaHoc.DisplayMember = "TenKhoaHoc";
            cboKhoaHoc.ValueMember   = "KhoaHocId";

            gridKetQuaTimKiem.AutoGenerateColumns = false;

            btnTimKiem_Click(sender, e);
        }
 private void LoadKhoaHoc()
 {
     try
     {
         KhoaHocFilter _filter = new KhoaHocFilter();
         _filter.CoSoId   = GlobalSettings.CoSoId;
         _filter.IsRemove = 0;
         List <KhoaHoc_PlusDTO> _lstKhoaHoc = KhoaHocLogic.Select(_filter);
         cboKhoaHoc.DataSource    = _lstKhoaHoc;
         cboKhoaHoc.DisplayMember = "TenKhoaHoc";
         cboKhoaHoc.ValueMember   = "KhoaHocId";
         if (_lstKhoaHoc != null && _lstKhoaHoc.Count > 0)
         {
             cboKhoaHoc.SelectedIndex = 0;
             LoadLopCuaKhoaHoc();
         }
     }
     catch (Exception ex)
     {
         O2S_Common.Logging.LogSystem.Warn(ex);
     }
 }
        private void frmLapPhieuGhiDanh_Option1_Load(object sender, EventArgs e)
        {
            try
            {
                date_TuNgay.DateTime  = Convert.ToDateTime(DateTime.Now.AddMonths(-3).ToString("yyyy-MM-dd") + " 00:00:00");
                date_DenNgay.DateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59");
                KhoaHocFilter _filter = new KhoaHocFilter();
                _filter.CoSoId           = GlobalSettings.CoSoId;
                cboKhoaHoc.DataSource    = KhoaHocLogic.Select(_filter);
                cboKhoaHoc.DisplayMember = "TenKhoaHoc";
                cboKhoaHoc.ValueMember   = "KhoaHocId";
                LoadPhieuGhiDanh();
                LoadKhoanKhacMacDinh();
                LoadDanhSachHocVien();
                LoadQuyDinh_LapPhieuGD();

                btnLuuPhieu.Enabled  = false;
                btnInBienLai.Enabled = false;
            }
            catch (Exception ex)
            {
                O2S_Common.Logging.LogSystem.Warn(ex);
            }
        }