private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Visible = false;

            Sup_account_get getacDetails = new Sup_account_get();

            getacDetails.sp_acNo     = View_Suppliers.dgv.CurrentRow.Cells["Supplier_No"].Value.ToString();
            getacDetails.sp_acFnme   = View_Suppliers.dgv.CurrentRow.Cells["First_Name"].Value.ToString();
            getacDetails.sp_acLnme   = View_Suppliers.dgv.CurrentRow.Cells["Last_Name"].Value.ToString();
            getacDetails.sp_acBisnme = View_Suppliers.dgv.CurrentRow.Cells["Business_Name"].Value.ToString();
            getacDetails.sp_acMob    = View_Suppliers.dgv.CurrentRow.Cells["Mobile"].Value.ToString();
            getacDetails.sp_acemail  = View_Suppliers.dgv.CurrentRow.Cells["Email"].Value.ToString();

            Supplier_Account SupACC = new Supplier_Account(getacDetails);

            SupACC.ShowDialog(this);
        }
        public void btnViewSuppViewAcc_Click(object sender, EventArgs e)
        {
            try
            {
                Sup_account_get getacDetails = new Sup_account_get();
                getacDetails.sp_acNo     = dgvViewSupp.CurrentRow.Cells["Supplier_No"].Value.ToString();
                getacDetails.sp_acFnme   = dgvViewSupp.CurrentRow.Cells["First_Name"].Value.ToString();
                getacDetails.sp_acLnme   = dgvViewSupp.CurrentRow.Cells["Last_Name"].Value.ToString();
                getacDetails.sp_acBisnme = dgvViewSupp.CurrentRow.Cells["Business_Name"].Value.ToString();
                getacDetails.sp_acMob    = dgvViewSupp.CurrentRow.Cells["Mobile"].Value.ToString();
                getacDetails.sp_acemail  = dgvViewSupp.CurrentRow.Cells["Email"].Value.ToString();



                Supplier_Account SupACC = new Supplier_Account(getacDetails);
                SupACC.ShowDialog(this);
            }
            catch (Exception) { }
        }
        private void btnok_Click(object sender, EventArgs e)
        {
            if (radioButton_nmal.Checked)
            {
                stktyp = "Normal";
            }
            if (radioButton_qty.Checked)
            {
                stktyp = "Quantity";
            }

            try
            {
                if (dtp_AccUp.Text != "" && cbx_pymetd.Text != "" && cbx_supp.Text != "" && cbx_qty_ctgy.Text != "" && cbx_qty_S_ctgy.Text != "" && cbx_qty_Brand.Text != "" && txt_paid.Text != "" && txt_u_p_priz.Text != "" && txt_u_s_priz.Text != "" && numericUpDown1.Value != 0 && cbx_itmtype.Text != "")
                {
                    supOp.Update_SupAcc(lbl_s_no.Text, dtp_AccUp.Value, cbx_supp.Text, txtDiscription.Text, cbx_pymetd.Text, Convert.ToDecimal(txtPurchasePrice.Text), Convert.ToDecimal(txt_paid.Text), cbx_qty_ctgy.Text, cbx_qty_S_ctgy.Text, cbx_qty_Brand.Text, Convert.ToDecimal(txt_u_p_priz.Text), Convert.ToDecimal(txt_u_s_priz.Text), numericUpDown1.Value, cbx_itmtype.Text, stktyp);
                    MessageBox.Show("Stock Details Updated sucessfully", "Sharp Creations", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    this.Visible = false;
                    Sup_account_get getacDetails = new Sup_account_get();
                    getacDetails.sp_acNo     = View_Suppliers.dgv.CurrentRow.Cells["Supplier_No"].Value.ToString();
                    getacDetails.sp_acFnme   = View_Suppliers.dgv.CurrentRow.Cells["First_Name"].Value.ToString();
                    getacDetails.sp_acLnme   = View_Suppliers.dgv.CurrentRow.Cells["Last_Name"].Value.ToString();
                    getacDetails.sp_acBisnme = View_Suppliers.dgv.CurrentRow.Cells["Business_Name"].Value.ToString();
                    getacDetails.sp_acMob    = View_Suppliers.dgv.CurrentRow.Cells["Mobile"].Value.ToString();
                    getacDetails.sp_acemail  = View_Suppliers.dgv.CurrentRow.Cells["Email"].Value.ToString();

                    Supplier_Account SupACC = new Supplier_Account(getacDetails);
                    SupACC.ShowDialog(this);
                }

                else
                {
                    errorProvider1.SetError(cbx_supp, "");
                    errorProvider2.SetError(txtDiscription, "");

                    errorProvider5.SetError(cbx_pymetd, "");
                    errorProvider6.SetError(dtp_AccUp, "");


                    if (dtp_AccUp.Text == "")
                    {
                        errorProvider6.SetError(dtp_AccUp, "Enter supplier city ");
                    }
                    else
                    {
                    }



                    if (cbx_supp.Text == "")
                    {
                        errorProvider1.SetError(cbx_supp, "Choose Supplier Name ");
                    }
                    else
                    {
                    }


                    if (cbx_pymetd.Text == "")
                    {
                        errorProvider5.SetError(cbx_pymetd, "Choose Paid Method ");
                    }
                    else
                    {
                    }
                }
            }



            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #4
0
 public Supplier_Account(Sup_account_get accD)
 {
     InitializeComponent();
     gc = accD;
 }