private void ModifyBdc(ModelViewBdc bdc) { if (gridViewOrder == null) { return; } bdc = (ModelViewBdc)gridViewOrder.GetFocusedRow(); EditBdc(bdc, false, null); }
private void EditBdc(ModelViewBdc bdc, bool newBdc, string caption) { Cursor.Current = Cursors.WaitCursor; var form = new FrmEditBdc(bdc, newBdc, caption); form.Location = new Point(OwnerForm.Left + (OwnerForm.Width - form.Width) / 2, OwnerForm.Top + (OwnerForm.Height - form.Height) / 2); form.ShowDialog(); Bdc2_Load(bdc, new EventArgs()); Cursor.Current = Cursors.Default; }
private void EditOrderLine(ModelViewOrderLine orderLine, bool newBdc) { Cursor.Current = Cursors.WaitCursor; var form = new FrmEditOrderLine(Stocks, orderLine, newBdc); form.Location = new Point(OwnerForm.Left + (OwnerForm.Width - form.Width) / 2, OwnerForm.Top + (OwnerForm.Height - form.Height) / 2); form.ShowDialog(); var bdc = new ModelViewBdc(); Bdc2_Load(bdc, new EventArgs()); Cursor.Current = Cursors.Default; }
internal FrmEditBdc(ModelViewBdc bdc, bool newBdc, string caption) { InitializeComponent(); LigneCommande = null; var repositoryClient = new RepositoryClient(); var repositoryStock = new RepositoryStock(); var repositoryOrder = new RepositoryOrder(); _editBdcPresenter = new EditBdcPresenterPage(this, repositoryClient, repositoryStock, repositoryOrder, OrderLines); _editBdcPresenter.Display(); comboBoxClients.DataSource = Clients.OrderBy(cl => cl.Name).ToList(); comboBoxClients.DisplayMember = "Name"; comboBoxClients.ValueMember = "Name"; comboBoxPriorite.DataSource = Enum.GetValues(typeof(Priorite)); comboBoxEtat.DataSource = Enum.GetValues(typeof(GestionCommande)); gridViewOrderLine.Columns[0].FieldName = "Product.Name"; if (!newBdc) { IdOrder = bdc.Id; textEditNumCommande.Text = bdc.NumCommande.ToString(CultureInfo.InvariantCulture); comboBoxClients.SelectedValue = bdc.NameClient; dateEditLivraison.Text = bdc.DateLivraison.ToShortDateString(); memoEditAdresssLivraion.Text = bdc.AdresseLivraison; comboBoxPriorite.SelectedItem = bdc.Priorite; comboBoxEtat.SelectedItem = bdc.Etat; dateEditCommande.Text = bdc.Datecommande.ToShortDateString(); var orderline1 = new OrderLine(); foreach (var lc in bdc.OrderLines) { orderline1.id = lc.Id; orderline1.Product = lc.Product; orderline1.Quantity = lc.Quantity; OrderLines.Add(new OrderLine { id = lc.Id, Product = lc.Product, Quantity = lc.Quantity }); } radiogroupLivraisonSurPlace.EditValue = bdc.LivraisonSurPlace; GCOrderLine.DataSource = OrderLines; } else { GCOrderLine.DataSource = OrderLines; } IsBdcModified = false; _newBdc = newBdc; _sourceBdc = bdc; }
private void DeleteBdc() { DialogResult result = XtraMessageBox.Show(this, TagResources.DeleteQuestion, Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); if (result != DialogResult.Yes) { return; } if (gridViewOrder == null) { return; } var idorder = (Guid)gridViewOrder.GetFocusedRowCellValue("Id"); _repositoryOrder.Remove(idorder); var bdc = new ModelViewBdc(); Bdc2_Load(bdc, new EventArgs()); }
private void CreateBdc() { var bdc = new ModelViewBdc(); EditBdc(bdc, true, null); }
private void RefreshBdc() { var bdc = new ModelViewBdc(); Bdc2_Load(bdc, new EventArgs()); }