public ClientsForm() { InitializeComponent(); db = new BrickWorksModel(); LoadClients(); }
private async void lnkEdit_Click(object sender, EventArgs e) { int id = Convert.ToInt32(ordersGrid.SelectedRows[0].Cells[0].Value); Order ord = db.Orders.First(o => o.Id == id); if (ord != null) { using (OrderAddEditForm frm = new OrderAddEditForm(ord)) { frm.StyleManager = styleManager; if (frm.ShowDialog(this) == DialogResult.OK) { try { await db.SaveChangesAsync(); db = new BrickWorksModel(); LoadOrders(); } catch (Exception ex) { MetroFramework.MetroMessageBox.Show(this, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } ordersGrid.Refresh(); } } }
public BricksFrom() { InitializeComponent(); db = new BrickWorksModel(); manufacturedBrickBindingSource.DataSource = db.ManufacturedBricks.OrderByDescending(m => m.Id).ToList(); brickBindingSource.DataSource = db.Bricks.ToList(); }
public BricksCostForm() { InitializeComponent(); db = new BrickWorksModel(); brickCostBindingSource.DataSource = db.BrickCosts.OrderByDescending(d => d.Date).ToList(); brickBindingSource.DataSource = db.Bricks.ToList(); }
public BricksCostsForm() { InitializeComponent(); costGrid.Theme = this.Theme; costGrid.Style = this.Style; db = new BrickWorksModel(); deliveryCostBindingSource.DataSource = db.DeliveryCosts.OrderByDescending(d => d.Date).ToList(); }
public OrderAddEditForm(Order obj) { db = new BrickWorksModel(); OrderInfo = obj; InitializeComponent(); orderBindingSource.DataSource = OrderInfo; clientBindingSource.DataSource = db.Clients.ToList(); LoadBricks(); }
public ClientAddEditForm(Client obj) { InitializeComponent(); ClientInfo = obj; db = new BrickWorksModel(); clientBindingSource.DataSource = ClientInfo; buildingBindingSource.DataSource = db.Buildings.Where(c => c.ClientID == ClientInfo.Id).ToList(); buildingsGrid.Refresh(); }
public ManufacturedBrickAddEditFrom(ManufacturedBrick obj) { db = new BrickWorksModel(); MFInfo = obj; InitializeComponent(); brickBindingSource.DataSource = db.Bricks.ToList(); manufacturedBrickBindingSource.DataSource = MFInfo; mDate.Select(); }
public BrickCostAddEditForm(BrickCost obj) { InitializeComponent(); BrickCostInfo = obj; db = new BrickWorksModel(); if (BrickCostInfo.Id == 0) { BrickCostInfo.BrickId = db.Bricks.First().Id; } brickCostBindingSource.DataSource = BrickCostInfo; this.mdtDate.Select(); brickBindingSource.DataSource = db.Bricks.ToList(); }
public BricksInOrderAddEditFrom(OrderedBrick obj) { InitializeComponent(); OrderedBrickInfo = obj; db = new BrickWorksModel(); if (OrderedBrickInfo.Id == 0) { OrderedBrickInfo.BrickId = db.Bricks.First().Id; } orderedBrickBindingSource.DataSource = OrderedBrickInfo; brickBindingSource.DataSource = db.Bricks.ToList(); CalcRemaindedBricks(); }
public OrdersForm() { try { db = new BrickWorksModel(); InitializeComponent(); this.StyleManager = styleManager; styleManager.Theme = MetroFramework.MetroThemeStyle.Light; styleManager.Style = MetroFramework.MetroColorStyle.Orange; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public DeliveryCostCalc(int ClientId, DateTime OrderDate) { InitializeComponent(); DeliveryCost = 0; mlvBuildings.CheckBoxes = true; this.ClientId = ClientId; this.OrderDate = OrderDate; db = new BrickWorksModel(); var buildings = db.Buildings.Where(b => b.ClientID == ClientId); foreach (var building in buildings) { var item = new ListViewItem(); item.Tag = building.Id; item.Text = building.Address; mlvBuildings.Items.Add(item); } }
public CalcBricksFrom(int ClientId, int BrickId) { InitializeComponent(); Quantity = 0; mlvBuildings.CheckBoxes = true; this.ClientId = ClientId; this.BrickId = BrickId; db = new BrickWorksModel(); var buildings = db.Buildings.Where(b => b.ClientID == ClientId); foreach (var building in buildings) { var item = new ListViewItem(); item.Tag = building.Id; item.Text = building.Address; mlvBuildings.Items.Add(item); } }
public BricksInOrderView() { db = new BrickWorksModel(); }
public BricksTypesForm() { InitializeComponent(); db = new BrickWorksModel(); brickBindingSource.DataSource = db.Bricks.ToList(); }