public AddNewCustomerInPOS(POSNEW pOSNEW, string billno)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.pOSNEW = pOSNEW;
     bindcustomer();
     txtcusname.Focus();
     if (!string.IsNullOrEmpty(billno))
     {
         DataTable dt = conn.getdataset("select * from BillPOSMaster where isactive=1 and billno='" + billno + "' and isactive=1");
         txtcusname.Text   = dt.Rows[0]["customername"].ToString();
         txtcuscity.Text   = dt.Rows[0]["customercity"].ToString();
         txtcusmobile.Text = dt.Rows[0]["customermobile"].ToString();
     }
     else
     {
         pOSNEW.cusdetails();
         if (!string.IsNullOrEmpty(POSNEW.customername1))
         {
             txtcusname.Text = POSNEW.customername1;
         }
         if (!string.IsNullOrEmpty(POSNEW.customercity1))
         {
             txtcuscity.Text = POSNEW.customercity1;
         }
         if (!string.IsNullOrEmpty(POSNEW.customermobile1))
         {
             txtcusmobile.Text = POSNEW.customermobile1;
         }
         if (POSNEW.customername1 != "")
         {
             btnsubmit.Visible = false;
         }
     }
 }
 public CustomOrder(POSNEW pOSNEW, string billno)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.pOSNEW = pOSNEW;
     bindcustomer();
     txtcusname.Focus();
     options = conn.getdataset("select * from options");
     if (options.Rows.Count > 0)
     {
         if (options.Rows[0]["txtposadd1"].ToString() == "")
         {
             txtadd1.Visible = false;
             lbladd1.Visible = false;
         }
         else
         {
             lbladd1.Text = options.Rows[0]["txtposadd1"].ToString();
         }
         if (options.Rows[0]["txtposadd2"].ToString() == "")
         {
             txtadd2.Visible = false;
             lbladd2.Visible = false;
         }
         else
         {
             lbladd2.Text = options.Rows[0]["txtposadd2"].ToString();
         }
         if (options.Rows[0]["txtposadd3"].ToString() == "")
         {
             txtadd3.Visible = false;
             lbladd3.Visible = false;
         }
         else
         {
             lbladd3.Text = options.Rows[0]["txtposadd3"].ToString();
         }
         if (options.Rows[0]["txtposadd4"].ToString() == "")
         {
             txtadd4.Visible = false;
             lbladd4.Visible = false;
         }
         else
         {
             lbladd4.Text = options.Rows[0]["txtposadd4"].ToString();
         }
         if (options.Rows[0]["txtposadd5"].ToString() == "")
         {
             txtadd5.Visible = false;
             lbladd5.Visible = false;
         }
         else
         {
             lbladd5.Text = options.Rows[0]["txtposadd5"].ToString();
         }
         getorderno();
     }
     if (!string.IsNullOrEmpty(billno))
     {
         DataTable dt = conn.getdataset("select * from BillPOSMaster where isactive=1 and billno='" + billno + "' and isactive=1");
         txtcusname.Text = dt.Rows[0]["customername"].ToString();
     }
     else
     {
         pOSNEW.cusdetails();
         if (!string.IsNullOrEmpty(POSNEW.customername1))
         {
             txtcusname.Text = POSNEW.customername1;
         }
         if (!string.IsNullOrEmpty(POSNEW.customercity1))
         {
             txtcuscity.Text = POSNEW.customercity1;
         }
         if (!string.IsNullOrEmpty(POSNEW.customermobile1))
         {
             txtcusmobile.Text = POSNEW.customermobile1;
         }
         if (POSNEW.customername1 != "")
         {
             btnsubmit.Visible = false;
         }
     }
 }