private void btnSetWaiting_Click(object sender, EventArgs e) { var items = GetInvoiceItemsDS(); if (items == null || items.Count == 0) { MessageBox.Show(this, "No items to set!", "Waiting for products", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string inittext = string.Empty; if (items[0].Parent != null) inittext = items[0].Parent.OrderNumber; TextInputForm orderNum = new TextInputForm("Enter an order number", inittext); orderNum.ShowDialog(this); if (orderNum.ReturnText == null) return; TextInputForm comment = new TextInputForm("Enter a comment", items[0].Parent.CustomerName); comment.ShowDialog(this); int count = 0; foreach (var item in items) { if (/*item.PairProduct == null || (item.PairCode != null &&*/ item.PairCode == "shipping") continue; // produkty oznacime ako cakajuce na dalsie, pri exporte sa ulozia do DB.. if (item.PairProduct != null) { item.PairProduct.State = StockItemState.Waiting; item.PairProduct.Sklad = Properties.Settings.Default.Storage; item.PairProduct.WaitingOrderNum = orderNum.ReturnText; } count++; // ulozenie entity do DB var dbEnt = item.GetWaitingEntity(); dbEnt.InvoiceNr = orderNum.ReturnText; dbEnt.Comment = comment.ReturnText; dbEnt.Save(); } MessageBox.Show(this, string.Format("{0} products set as waiting.", count), "Waiting for products", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnSetTrashNr_Click(object sender, EventArgs e) { TextInputForm frm = new TextInputForm("Číslo košíka", "Zadajte číslo košíka"); var res = frm.ShowDialog(); if (res == DialogResult.OK) { SetTrashNumber(frm.ReturnText); } }