Beispiel #1
0
        private void btndelete_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Do you want to Delete Bill?", "Bill", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                getcon();
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                con.Open();
                //SqlCommand cmd = new SqlCommand("update PurchaseOrderMaster set isactive=0  where VchNo='" + txtVchNo.Text + "' and CompanyId=" + compid + "", con);
                //cmd.ExecuteNonQuery();
                string     qry = "update PurchaseOrderMaster set isactive=0  where VchNo='" + txtVchNo.Text + "' and CompanyId=" + compid + "";
                SqlCommand cmd = new SqlCommand(qry, con);
                LogGenerator.Info(qry);
                cmd.ExecuteNonQuery();
                lcon.execute("Insert into sync values('" + qry.Replace("'", "\"") + "')");
                SqlCommand cmd2 = new SqlCommand("update PurchaseOrderProductMaster set isactive=0 where VchNo='" + txtVchNo.Text + "'and CompanyId=" + compid, con);
                cmd2.ExecuteNonQuery();
                string qry1 = "update PurchaseOrderProductMaster set isactive=0 where VchNo='" + txtVchNo.Text + "' and CompanyId=" + compid + "";
                lcon.execute("Insert into sync values('" + qry1.Replace("'", "\"") + "')");
                LogGenerator.Info(qry1);
                clearall();
                clearitem();
                LVFO.Clear();
                this.Close();
                DateWisePurchaseReport frm = new DateWisePurchaseReport();
                frm.MdiParent     = this.MdiParent;
                frm.StartPosition = FormStartPosition.CenterScreen;
                frm.Show();
            }
            else
            {
                if (cmbPurchaseType.Text == "" || cmbCustName.Text == "" || cmbTerms.Text == "")
                {
                    MessageBox.Show("Please fill all the information.");
                    if (cmbPurchaseType.Text == "")
                    {
                        cmbPurchaseType.Focus();
                    }
                    else if (cmbCustName.Text == "")
                    {
                        cmbCustName.Focus();
                    }
                    else if (cmbTerms.Text == "")
                    {
                        cmbTerms.Focus();
                    }
                }
            }
        }
 public Purchase(DateWisePurchaseReport dateWisePurchaseReport)
 {
     InitializeComponent();
     this.dateWisePurchaseReport = dateWisePurchaseReport;
     loadcurrency();
 }
 public BillDetails(DateWisePurchaseReport dateWisePurchaseReport)
 {
     // TODO: Complete member initialization
     this.dateWisePurchaseReport = dateWisePurchaseReport;
 }