Beispiel #1
0
        private void btnsubmit()
        {
            try
            {
                getcon();
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                con.Open();
                // dtpo = conn.getdataset("Select isGenerated,GeneDate from PurchaseOrderMaster order by vchno desc ");
                // DataTable dtup = new DataTable();
                // dtup = conn.getdataset("Select * from PurchaseOrderMaster where OrderDate='" + DateTime.Now.ToString("yyyy-MM-dd 00:00:00") + "' and isactive=1");
                DialogResult dr = MessageBox.Show("Do you want to Generate Sale Order?", "Bill", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    if (cmbPurchaseType.Text == "" || cmbCustName.Text == "" || cmbTerms.Text == "")
                    {
                        MessageBox.Show("Please fill all the information.");
                        if (cmbTerms.Text == "")
                        {
                            cmbTerms.Focus();
                        }

                        else if (cmbCustName.Text == "")
                        {
                            cmbCustName.Focus();
                        }
                        else if (cmbPurchaseType.Text == "")
                        {
                            cmbPurchaseType.Focus();
                        }
                    }
                    else
                    {
                        insertorupdate();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:" + ex.Message);
                LogGenerator.Error(ex.Message, ex);
            }
            finally
            {
                con.Close();
            }
        }
Beispiel #2
0
 public void Error()
 {
     _logGenerator.Error();
 }