public void manageReceiptToolStripMenuItem_Click(object sender, EventArgs e) { ManageReceipt MReceiptfmus = new ManageReceipt(lblWelcome.Text); // MReceiptfmus.ShowDialog(); MReceiptfmus.Show(); }
private void ddlCalulationMode_SelectedIndexChanged(object sender, EventArgs e) { int ActualQuantity = 0; int MinimumQuantity = 0; lblMinimumStock.Text = ""; if (!string.IsNullOrEmpty(txtBarcode.Text)) { txtPrice.Enabled = false; txtProductName.Enabled = false; txtDescription.Enabled = false; txtunit.Enabled = false; txtmin.Visible = false; txtBrand.Enabled = false; dgvReceipt.Refresh(); ManageReceipt MR = new ManageReceipt(lbluser.Text); // dgvReceipt.DataSource = searchProductss(Convert.ToInt32(txtBarcode.Text)); DataTable ManageReceipt = new DataTable(); ManageReceipt = searchProductss(Convert.ToString(txtBarcode.Text)); foreach (DataRow row in ManageReceipt.Rows) { txtProductName.Text = ""; txtPrice.Text = ""; txtQuantity.Text = ""; txtProductName.Text = row["PRO_Name"].ToString(); if (ddlCalulationMode.SelectedItem.Equals("RETAIL")) { txtPrice.Text = row["PRICE"].ToString(); } else { txtPrice.Text = row["WholeSale"].ToString();; } txtQuantity.Text = row["STOCK_QTE"].ToString(); txtDescription.Text = row["DESCRIPTION"].ToString(); txtunit.Text = row["Quantity_unit"].ToString(); txtmin.Text = row["Minimum_Quantity"].ToString(); lblMinimumStock.Text = row["STOCK_QTE"].ToString(); lblMinimumStock.Text = string.Format("{0} Remaining Quantity Is available ", lblMinimumStock.Text); // txtWholeSale = row["WholeSale"].ToString(); txtBrand.Text = row["Brand"].ToString(); ActualQuantity = Convert.ToInt32(txtQuantity.Text); MinimumQuantity = Convert.ToInt32(txtmin.Text); if (ActualQuantity <= MinimumQuantity) { MessageBox.Show("Quantity Stock is ON Minimum Level please Proceed With Order", "Empty Data", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } else { txtBarcode.Text = ""; txtProductName.Text = ""; txtPrice.Text = ""; txtQuantity.Text = ""; txtDescription.Text = ""; txtPrice.Enabled = false; txtProductName.Enabled = false; txtDescription.Enabled = false; txtBrand.Text = ""; } }