public static List <CAUHINHEMAIL> Select(CauHinhEmailFilter _filter) { try { var query = (from p in GlobalSettings.Database.CAUHINHEMAILs select p).ToList(); if (_filter.CoSoId != null && _filter.CoSoId != 0) { query = query.Where(o => o.CoSoId == _filter.CoSoId).ToList(); } return(query.ToList()); } catch (System.Exception ex) { return(null); O2S_Common.Logging.LogSystem.Error(ex); } }
private void LoadGridCauHinhEmail() { try { CauHinhEmailFilter _filter = new CauHinhEmailFilter(); _filter.CoSoId = GlobalSettings.CoSoId; List <CAUHINHEMAIL> _lstCauHinhEmail = CauHinhEmailLogic.Select(_filter); if (_lstCauHinhEmail != null && _lstCauHinhEmail.Count > 0) { gridControlEmail.DataSource = _lstCauHinhEmail; } else { gridControlEmail.DataSource = null; } lblTongCong.Text = string.Format("Tổng cộng: {0}", gridViewEmail.RowCount); } catch (Exception ex) { O2S_Common.Logging.LogSystem.Warn(ex); } }
private void frmHocVienTiemNang_GuiMail_Load(object sender, EventArgs e) { try { //Load ds nguoi gui. CauHinhEmailFilter _filter = new CauHinhEmailFilter(); _filter.CoSoId = GlobalSettings.CoSoId; cboEmailGui.DataSource = CauHinhEmailLogic.Select(_filter); cboEmailGui.DisplayMember = "TaiKhoan"; cboEmailGui.ValueMember = "CauHinhEmailId"; HOCVIEN _hocvien = HocVienLogic.SelectSingle(this.HocVienId_Select); lblMaHocVien.Text = _hocvien.MaHocVien; lblTenHocVien.Text = _hocvien.TenHocVien; txtEmailNhan.Text = _hocvien.Email; txtTieuDeMail.Focus(); } catch (Exception ex) { O2S_Common.Logging.LogSystem.Error(ex); } }