private void dataGridViewRequirementByCust_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            // MessageBox.Show("column index "+e.ColumnIndex.ToString());
            if (e.ColumnIndex == 0)
            {
                int availableproduct = Convert.ToInt32(dataGridViewRequirementByCust.Rows[e.RowIndex].Cells[4].Value.ToString());
                int quantityrequired = Convert.ToInt32(dataGridViewRequirementByCust.Rows[e.RowIndex].Cells[3].Value.ToString());

                if (availableproduct < quantityrequired)
                    MessageBox.Show("Not enough stock to do the transaction");
                else
                {
                    string customername = dataGridViewRequirementByCust.Rows[e.RowIndex].Cells[2].Value.ToString();

                    int rowindex=dataGridViewRequirementList.CurrentCell.RowIndex;

                    string productname=dataGridViewRequirementList.Rows[rowindex].Cells[0].Value.ToString();
                    string orderid = dataGridViewRequirementByCust.Rows[e.RowIndex].Cells[1].Value.ToString();
                    MessageBox.Show(orderid);
                    BillingSales newbill = new BillingSales(customername, productname, quantityrequired,false);
                    newbill.ShowDialog();
                    string changestate = "update productionorder set deliverystatus='" + quantityrequired.ToString() + "',orderstatus=1 where orderid='"+orderid+"'";
                    dbConnection.exenonquery(changestate);
                    //MessageBox.Show("\nOrderID:" + orderid + "\nproductname:" + productname + "\ncustomername:" + customername + "\nquantityrequired :" + quantityrequired.ToString());

                }

               // MessageBox.Show("button clicked");
            }
        }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != null)
     {
         BillingSales blsale = new BillingSales(textBox1.Text);
         blsale.Show();
     }
 }
示例#3
0
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (MessageBox.Show("Do you want to print this bill?", "Print Old Bill", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         BillingSales blsale = new BillingSales(dataGridViewBillDetails.Rows[e.RowIndex].Cells[0].Value.ToString());
         blsale.MdiParent = MDImainwnd.ActiveForm;
         blsale.Show();
     }
 }
示例#4
0
        private void buttonreturnprod_Click(object sender, EventArgs e)
        {
            //string newprod = dbConnection.executescalar("select top(1) serialno from products where productID='" + prodid + "'");
            if (insufficientstock == false)
            {
                DialogResult rs = MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNo);
                if (rs == DialogResult.Yes)
                {
                    dbConnection.exenonquery("update product set salestatus='REPLACED' where serialno='" + textBoxSnoDefective.Text + "'");
                    string customername=dbConnection.executescalar("select customername from customer where customer_id='"+customerid+"'");
                    string prodname=dbConnection.executescalar("select itemname from productdetails where productID='"+prodid+"'");
                    BillingSales billsale = new BillingSales(customername, prodname, 1,true);
                    billsale.Show();

                }
            }
            else
                MessageBox.Show("Not enough stock to replace the product");
        }
示例#5
0
        private void salesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            dataGridViewRequirementlist.Hide();
            label1.Hide();

            BillingSales billsale = new BillingSales();
            billsale.Disposed += new EventHandler(billsale_Disposed);
            billsale.MdiParent = MDImainwnd.ActiveForm;
            billsale.Show();
        }