Ejemplo n.º 1
0
 private void addPartyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         var frm = new frm_AddCustomer();
         frm.MdiParent = this; // assign MdiParent of FormB to FormC
         frm.Dock      = DockStyle.Fill;
         frm.Show();
     }
     catch (Exception)
     {
     }
 }
        private void frm_SaleOrder_Activated(object sender, EventArgs e)
        {
            try
            {
                String CustomerCount   = SQL.ScalarQuery("SELECT COUNT(CustomerName) FROM  CustomerMaster WHERE CustomerActive =1 and CompanyID=" + Main.CompanyID + "");
                String ProductCount    = SQL.ScalarQuery("SELECT COUNT(PName) FROM  ProductMaster WHERE PActive =1 and CompanyID=" + Main.CompanyID + "");
                String PurchaseInvType = SQL.ScalarQuery("SELECT COUNT(DocType) FROM  DocType WHERE Doctype ='Sale' and CompanyID=" + Main.CompanyID + "");

                if (CustomerCount == "0")
                {
                    MessageBox.Show("No Custoemr Is Found Please Enter Customer Details ", "Suggestion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    var frm = new frm_AddCustomer();
                    frm.ShowDialog();
                    //this.Close();
                }
                else if (ProductCount == "0")
                {
                    MessageBox.Show("No Product Is Found Please Enter Product Details ", "Suggestion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    var frm = new frm_AddProduct();
                    frm.ShowDialog();
                    //this.Close();
                }
                else if (PurchaseInvType == "0")
                {
                    MessageBox.Show("No Voucher Is Found Please Enter Voucher Detials ", "Suggestion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    var frm = new frm_AddProduct();
                    frm.ShowDialog();
                    //this.Close();
                }
                else
                {
                    Main.fillCombo(cmb_CustomerName, "CustomerMaster", "CustomerName", "CustomerID", "CustomerActive=1");
                    Main.fillCombo(cmb_ProductName, "ProductMaster", "PName", "PID", "PActive=1");
                    Main.fillCombo(cmb_InvoiceType, "Doctype", "Doctype", "DocID", "Doctype='Sale'");
                }
            }
            catch (Exception)
            {
            }
            GenerateInvoiceNo();
            //  cmb_InvoiceType.SelectedIndex = 1;
        }
Ejemplo n.º 3
0
 private void frm_CashTemp_Activated(object sender, EventArgs e)
 {
     try
     {
         String CustomerCount = SQL.ScalarQuery("SELECT COUNT(CustomerName) FROM  CustomerMaster WHERE CustomerActive =1 and CompanyID=" + Main.CompanyID + "");
         if (CustomerCount == "0")
         {
             MessageBox.Show("No Custoemr Is Found Please Enter Customer Details ", "Suggestion", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             var frm = new frm_AddCustomer();
             frm.ShowDialog();
             this.Close();
         }
         else
         {
             Main.fillCombo(cmb_CustomerName, "CustomerMaster", "CustomerName", "CustomerID", "CustomerActive=1");
         }
     }
     catch (Exception)
     {
     }
 }