Example #1
0
        public void open()
        {
            String str = lvqp.Items[lvqp.FocusedItem.Index].SubItems[2].Text;

            QPayment bd = new QPayment(master, tabControl);

            bd.updatemode(str, lvqp.Items[lvqp.FocusedItem.Index].SubItems[1].Text, 1, lvqp.Items[lvqp.FocusedItem.Index].SubItems[0].Text);
            master.AddNewTab(bd);
        }
        public void open()
        {
            if (LVledger.Items[LVledger.FocusedItem.Index].SubItems[1].Text == "Sale")
            {
                string[] strfinalarray = new string[5] {
                    "S", "D", "Sale", "", ""
                };
                string billno = LVledger.Items[LVledger.FocusedItem.Index].SubItems[2].Text.Remove(0, 9);

                String      str = LVledger.Items[LVledger.FocusedItem.Index].SubItems[0].Text;
                DataTable   dt1 = conn.getdataset("select * from FormFormat where isactive=1 and type='" + strfinalarray[0] + "' and setdefault=1");
                DefaultSale bd  = new DefaultSale(this, master, tabControl, strfinalarray);
                //   Sale p = new Sale(this, master, tabControl);
                if (dt1.Rows[0]["formname"].ToString() == bd.Text)
                {
                    bd.updatemode(str, billno, 1, strfinalarray);
                    //bd.MdiParent = this.MdiParent;
                    //bd.StartPosition = FormStartPosition.CenterScreen;
                    //bd.Show();
                    master.AddNewTab(bd);
                }
                //else if (dt1.Rows[0]["formname"].ToString() == p.Text)
                //{
                //    p.updatemode(str, mouseclickid.Rows[LVledger.FocusedItem.Index][1].ToString(), 1);
                //    //p.MdiParent = this.MdiParent;
                //    //p.StartPosition = FormStartPosition.CenterScreen;
                //    //p.Show();
                //    master.AddNewTab(p);
                //}



                bd.Show();
            }
            else if (LVledger.Items[LVledger.FocusedItem.Index].SubItems[1].Text == "Sale Return")
            {
                string[] strfinalarray = new string[5] {
                    "SR", "C", "Sale Return", "SR", ""
                };
                string billno = LVledger.Items[LVledger.FocusedItem.Index].SubItems[2].Text.Remove(0, 9);

                String      str = LVledger.Items[LVledger.FocusedItem.Index].SubItems[0].Text;
                DataTable   dt1 = conn.getdataset("select * from FormFormat where isactive=1 and type='" + strfinalarray[0] + "' and setdefault=1");
                DefaultSale bd  = new DefaultSale(this, master, tabControl, strfinalarray);
                //    Sale p = new Sale(this, master, tabControl);
                if (dt1.Rows[0]["formname"].ToString() == bd.Text)
                {
                    bd.updatemode(str, billno, 1, strfinalarray);
                    //bd.MdiParent = this.MdiParent;
                    //bd.StartPosition = FormStartPosition.CenterScreen;
                    //bd.Show();
                    master.AddNewTab(bd);
                }
                //else if (dt1.Rows[0]["formname"].ToString() == p.Text)
                //{
                //    p.updatemode(str, mouseclickid.Rows[LVledger.FocusedItem.Index][1].ToString(), 1);
                //    //p.MdiParent = this.MdiParent;
                //    //p.StartPosition = FormStartPosition.CenterScreen;
                //    //p.Show();
                //    master.AddNewTab(p);
                //}



                //  bd.Show();
            }
            else if (LVledger.Items[LVledger.FocusedItem.Index].SubItems[1].Text == "Purchase")
            {
                string[] strfinalarray = new string[5] {
                    "P", "C", "Purchase", "", ""
                };
                string    billno = LVledger.Items[LVledger.FocusedItem.Index].SubItems[2].Text.Remove(0, 9);
                String    str    = LVledger.Items[LVledger.FocusedItem.Index].SubItems[0].Text;
                DataTable dt1    = conn.getdataset("select * from FormFormat where isactive=1 and type='" + strfinalarray[0] + "' and setdefault=1");
                //DefaultPurchase frm = new DefaultPurchase(this);
                DefaultSale bd = new DefaultSale(this, master, tabControl, strfinalarray);
                //   Purchase p = new Purchase(this, master, tabControl);
                if (dt1.Rows[0]["formname"].ToString() == bd.Text)
                {
                    bd.updatemode(str, billno, 1, strfinalarray);
                    //bd.MdiParent = this.MdiParent;
                    //bd.StartPosition = FormStartPosition.CenterScreen;
                    //bd.Show();
                    master.AddNewTab(bd);
                }
                //else if (dt1.Rows[0]["formname"].ToString() == p.Text)
                //{
                //    p.updatemode(str, mouseclickid.Rows[LVledger.FocusedItem.Index][1].ToString(), 1);
                //    //p.MdiParent = this.MdiParent;
                //    //p.StartPosition = FormStartPosition.CenterScreen;
                //    //p.Show();
                //    master.AddNewTab(p);
                //}

                //    DefaultPurchase bd = new DefaultPurchase(this);

                //  bd.Show();
            }
            else if (LVledger.Items[LVledger.FocusedItem.Index].SubItems[1].Text == "Purchase Return")
            {
                string[] strfinalarray = new string[5] {
                    "PR", "D", "Purchase Return", "PR", ""
                };
                string    billno = LVledger.Items[LVledger.FocusedItem.Index].SubItems[2].Text.Remove(0, 9);
                String    str    = LVledger.Items[LVledger.FocusedItem.Index].SubItems[0].Text;
                DataTable dt1    = conn.getdataset("select * from FormFormat where isactive=1 and type='" + strfinalarray[0] + "' and setdefault=1");
                //DefaultPurchase frm = new DefaultPurchase(this);
                DefaultSale bd = new DefaultSale(this, master, tabControl, strfinalarray);
                //Purchase p = new Purchase(this, master, tabControl);
                if (dt1.Rows[0]["formname"].ToString() == bd.Text)
                {
                    bd.updatemode(str, billno, 1, strfinalarray);
                    //bd.MdiParent = this.MdiParent;
                    //bd.StartPosition = FormStartPosition.CenterScreen;
                    //bd.Show();
                    master.AddNewTab(bd);
                }
                //else if (dt1.Rows[0]["formname"].ToString() == p.Text)
                //{
                //    p.updatemode(str, mouseclickid.Rows[LVledger.FocusedItem.Index][1].ToString(), 1);
                //    //p.MdiParent = this.MdiParent;
                //    //p.StartPosition = FormStartPosition.CenterScreen;
                //    //p.Show();
                //    master.AddNewTab(p);
                //}
            }
            else if (LVledger.Items[LVledger.FocusedItem.Index].SubItems[1].Text == "Rect")
            {
                String str = LVledger.Items[LVledger.FocusedItem.Index].SubItems[2].Text;

                QReceipt bd = new QReceipt();
                bd.updatemode(str, mouseclickid.Rows[LVledger.FocusedItem.Index][1].ToString(), 1, LVledger.Items[LVledger.FocusedItem.Index].SubItems[0].Text);
                bd.Show();
            }
            else if (LVledger.Items[LVledger.FocusedItem.Index].SubItems[1].Text == "Pmnt")
            {
                String str = LVledger.Items[LVledger.FocusedItem.Index].SubItems[2].Text;

                QPayment bd = new QPayment();
                bd.updatemode(str, mouseclickid.Rows[LVledger.FocusedItem.Index][1].ToString(), 1, LVledger.Items[LVledger.FocusedItem.Index].SubItems[0].Text);
                bd.Show();
            }
        }