public void open()
 {
     try
     {
         this.Enabled = false;
         iid          = LVbill.Items[LVbill.FocusedItem.Index].SubItems[1].Text;
         DataTable  dt1 = sql.getdataset("select * from FormFormat where isactive=1 and type='POS' and setdefault=1");
         POSNEW     bd  = new POSNEW();
         DefaultPOS dlg = new DefaultPOS(master, tabControl);
         if (dt1.Rows[0]["formname"].ToString() == dlg.Text)
         {
             dlg.Update(1, iid);
             master.AddNewTab(dlg);
             dlg.Show();
         }
         else
         {
             bd.Update(1, iid);
             bd.Size          = new Size(this.Height, this.Width);
             bd.StartPosition = FormStartPosition.CenterScreen;
             bd.ShowDialog();
         }
     }
     finally
     {
         this.Enabled = true;
     }
 }
 public chequedetails(POSNEW pOSNEW, string billno)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.pOSNEW        = pOSNEW;
     this.ActiveControl = txtcusname;
     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]["customerchequename"].ToString();
         txtcusbank.Text     = dt.Rows[0]["customerchequebankname"].ToString();
         txtcuschequeno.Text = dt.Rows[0]["customercheckno"].ToString();
     }
     else
     {
         pOSNEW.chequedetail();
         if (!string.IsNullOrEmpty(POSNEW.chequecusname))
         {
             txtcusname.Text = POSNEW.chequecusname;
         }
         if (!string.IsNullOrEmpty(POSNEW.chequebankname))
         {
             txtcusbank.Text = POSNEW.chequebankname;
         }
         if (!string.IsNullOrEmpty(POSNEW.chequeno))
         {
             txtcuschequeno.Text = POSNEW.chequeno;
         }
     }
 }
 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 void getitem()
        {
            try
            {
                this.Close();
                string    batch = LVFO.Items[LVFO.FocusedItem.Index].SubItems[0].Text;
                DataTable dt1   = conn.getdataset("select * from FormFormat where isactive=1 and type='POS' and setdefault=1");
                //  POS bd = new POS(this, batch);
                POSNEW p = new POSNEW(this, batch);
                if (dt1.Rows[0]["formname"].ToString() == p.Text)
                {
                    p.getdata(LVFO.Items[LVFO.FocusedItem.Index].SubItems[0].Text, iname);
                    this.Close();
                }
                //else if (dt1.Rows[0]["formname"].ToString() == bd.Text)
                //{

                //    //  bd.updatemode(LVFO.Items[LVFO.FocusedItem.Index].SubItems[0].Text);
                //    //master.AddNewTab(bd);

                //}
            }
            catch
            {
            }
        }
 public POSMultiProduct(POSNEW pOSNEW, string p, string Itemname)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.pOSNEW   = pOSNEW;
     this.p        = p;
     this.Itemname = Itemname;
     loadpage();
     binddata(p);
     iname = Itemname;
 }
        private void btnnew_Click(object sender, EventArgs e)
        {
            //DefaultPOS dp = new DefaultPOS(master,tabControl);
            //master.AddNewTab(dp);
            DataTable  dt1 = sql.getdataset("select * from FormFormat where isactive=1 and type='POS' and setdefault=1");
            POSNEW     bd  = new POSNEW();
            DefaultPOS p   = new DefaultPOS(master, tabControl);

            if (dt1.Rows[0]["formname"].ToString() == p.Text)
            {
                master.AddNewTab(p);
                //bd.MdiParent = this.MdiParent;
                //bd.StartPosition = FormStartPosition.CenterScreen;
                //bd.Show();
            }
            else
            {
                bd.Size          = new Size(this.Height, this.Width);
                bd.StartPosition = FormStartPosition.CenterScreen;
                bd.ShowDialog();
            }
            //dp.Show();
        }
 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;
         }
     }
 }