private void textBoxQuantity_TextChanged(object sender, EventArgs e) { this.textBoxDozen.TextChanged -= new System.EventHandler(this.textBoxDozen_TextChanged); int qty = 0; int.TryParse(textBoxQuantity.Text, out qty); textBoxDozen.Text = SolFunctions.Quantity2Dozen(qty); this.textBoxDozen.TextChanged += new System.EventHandler(this.textBoxDozen_TextChanged); }
private void textBoxDefaultDozen_Click(object sender, EventArgs e) { decimal decValue = 0; decimal.TryParse(textBoxDefaultDozen.Text, out decValue); textBoxQuantity.Text = (decValue * 12).ToString(); int intValue = 0; int.TryParse(textBoxQuantity.Text, out intValue); textBoxDozen.Text = SolFunctions.Quantity2Dozen(intValue); }
private bool addItemStagedContainers(ref ListView lv1, string tagNumber, string product, int quantity, string container, int dozen) { string[] str = new string[5]; ListViewItem itm = new ListViewItem(); str[0] = tagNumber; str[1] = product; str[2] = String.Format("{0,3:##,##0}", quantity); str[3] = container; str[4] = SolFunctions.Quantity2Dozen(quantity); itm = new ListViewItem(str); lv1.Items.Add(itm); //this.arrayListViewCategoryId.Add(categoryId); return(true); }
private void FillForm() { //textBoxStageID.Text = sol_Stage.StageID.ToString(); textBoxUserName.Text = sol_Stage.UserName; textBoxDate.Text = sol_Stage.Date.ToString("G"); this.comboBoxProducts.SelectedIndexChanged -= new System.EventHandler(this.comboBoxProducts_SelectedIndexChanged); comboBoxProducts.SelectedValue = sol_Stage.ProductID; this.comboBoxProducts.SelectedIndexChanged += new System.EventHandler(this.comboBoxProducts_SelectedIndexChanged); //comboBoxProducts.Text = sol_Stage.ProductName; comboBoxContainers.SelectedValue = sol_Stage.ContainerID; //comboBoxContainers.Text = sol_Stage.ContainerDescription; textBoxQuantity.Text = sol_Stage.Quantity.ToString(); textBoxDozen.Text = SolFunctions.Quantity2Dozen(sol_Stage.Quantity); textBoxRemarks.Text = sol_Stage.Remarks; }
private void comboBoxProducts_SelectedIndexChanged(object sender, EventArgs e) { int Id = -1; try { Id = (int)comboBoxProducts.SelectedValue; } catch { return; } //delete row if it was new if (sol_Agency != null) { if (sol_Agency.AutoGenerateTagNumber) { if (buttonClicked == "&New") { DeleteStagedRow(); } } } //Sol_Product sol_Product = new Sol_Product(); if (sol_Product_Sp == null) { sol_Product_Sp = new Sol_Product_Sp(Properties.Settings.Default.WsirDbConnectionString); } sol_Product = sol_Product_Sp.Select(Id); comboBoxContainers.SelectedValue = sol_Product.ContainerID; //open table connection if (sol_Agency_Sp == null) { sol_Agency_Sp = new Sol_Agencie_Sp(Properties.Settings.Default.WsirDbConnectionString); } sol_Agency = sol_Agency_Sp.Select(sol_Product.AgencyID); //if (sol_Agency != null) //{ // Int32.TryParse(sol_Agency.VendorID, out intValue); // vendorId = intValue.ToString("0000"); //} if (sol_Agency.AutoGenerateTagNumber) { //add row if (AddStagedRow()) { textBoxTagNumber.Text = sol_Stage.TagNumber; textBoxTagNumber.ReadOnly = true; comboBoxContainers.Focus(); comboBoxProducts.Enabled = false; } else { buttonCancel.PerformClick(); } } else { textBoxTagNumber.ReadOnly = false; //textBoxTagNumber.Focus(); } //Sol_StandardDozen_Sp sol_StandardDozen_Sp = new Sol_StandardDozen_Sp(Properties.Settings.Default.WsirDbConnectionString); //Sol_StandardDozen sol_StandardDozen = sol_StandardDozen_Sp.Select(sol_Product.StandardDozenID); //textBoxDefaultDozen.Text = sol_StandardDozen.Quantity.ToString(); textBoxQuantity.Text = sol_Product.TargetQuantity.ToString(); textBoxDozen.Text = SolFunctions.Quantity2Dozen(sol_Product.TargetQuantity); }