private void FormLoad() { // This line of code is generated by Data Source Configuration Wizard // Instantiate a new DBContext DAL.QLDaiLyEntities dbContext = new DAL.QLDaiLyEntities(); // Call the LoadAsync method to asynchronously get the data for the given DbSet from the database. int maphieuxuat = int.Parse(lbMaPhieuXuat.Text); dbContext.CTPhieuXuatHangs.LoadAsync().ContinueWith(loadTask => { // Bind data to control when loading complete //cTPhieuXuatHangsBindingSource.DataSource = dbContext.CTPhieuXuatHangs.Local.ToBindingList(); cTPhieuXuatHangsBindingSource.DataSource = dbContext.CTPhieuXuatHangs.Where(p => p.MaPhieuXuat == maphieuxuat).ToList(); }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); // Prevent the focused cell from being highlighted. gridViewHangHoa.OptionsSelection.EnableAppearanceFocusedCell = false; // Draw a dotted focus rectangle around the entire row. gridViewHangHoa.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; // Tính số lượng hàng hóa int TongSoHangHoa = db.CTPhieuXuatHangs.Where(p => p.MaPhieuXuat == maphieuxuat).Count(); //int TongSoHangHoa = gridViewHangHoa.DataRowCount; lbTongHangHoa.Text = TongSoHangHoa.ToString(); }
private void cbDaiLy_EditValueChanged(object sender, EventArgs e) { if (cbDaiLy.EditValue == null) { lbDiaChi.Visible = false; lbEmail.Visible = false; lbTienNo.Visible = false; } else { DAL.QLDaiLyEntities db = new DAL.QLDaiLyEntities(); int madl = int.Parse(cbDaiLy.EditValue.ToString()); var daily = db.DaiLies .Where(d => d.MaDaiLy == madl) .FirstOrDefault(); lbDiaChi.Text = daily.DiaChi; lbEmail.Text = daily.Email; lbTienNo.Text = string.Format("{0:N0}", daily.TienNo); lbDiaChi.Visible = true; lbEmail.Visible = true; lbTienNo.Visible = true; } }
private void FormLoad() { // This line of code is generated by Data Source Configuration Wizard // Instantiate a new DBContext DAL.QLDaiLyEntities dbContext = new DAL.QLDaiLyEntities(); // Call the LoadAsync method to asynchronously get the data for the given DbSet from the database. dbContext.PhieuThuTiens.LoadAsync().ContinueWith(loadTask => { // Bind data to control when loading complete phieuThuTiensBindingSource.DataSource = dbContext.PhieuThuTiens.Local.ToBindingList(); }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); // Prevent the focused cell from being highlighted. gridViewThuTien.OptionsSelection.EnableAppearanceFocusedCell = false; // Draw a dotted focus rectangle around the entire row. gridViewThuTien.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; }
public frmTraCuuDaiLy() { InitializeComponent(); // This line of code is generated by Data Source Configuration Wizard // Instantiate a new DBContext DAL.QLDaiLyEntities dbContext = new DAL.QLDaiLyEntities(); // Call the LoadAsync method to asynchronously get the data for the given DbSet from the database. dbContext.DaiLies.LoadAsync().ContinueWith(loadTask => { // Bind data to control when loading complete // daiLiesBindingSource.DataSource = dbContext.DaiLies.Local.ToBindingList(); daiLiesBindingSource.DataSource = dbContext.DaiLies.Where(d => d.TinhTrang == 1).ToList(); }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); // Make the grid read-only. gridViewDaiLy.OptionsBehavior.Editable = false; // Prevent the focused cell from being highlighted. gridViewDaiLy.OptionsSelection.EnableAppearanceFocusedCell = false; // Draw a dotted focus rectangle around the entire row. gridViewDaiLy.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; }
public BUS_PhieuThuTien() { db = new DAL.QLDaiLyEntities(); }
public BUS_PhieuXuatHang() { db = new DAL.QLDaiLyEntities(); }
public BUS_Quan() { db = new DAL.QLDaiLyEntities(); }
public BUS_HangHoa() { db = new DAL.QLDaiLyEntities(); }
public BUS_DonViTinh() { db = new DAL.QLDaiLyEntities(); }
public BUS_DaiLy() { db = new DAL.QLDaiLyEntities(); }
public BUS_NguoiDung() { db = new DAL.QLDaiLyEntities(); }