public void setform() { this.Close(); String str = LVFO.Items[LVFO.FocusedItem.Index].SubItems[1].Text; DataTable dt1 = conn.getdataset("select * from FormFormat where isactive=1 and type='" + strfinalarray[0] + "' and setdefault=1"); DefaultSale bd = new DefaultSale(this, master, LVFO.Items[LVFO.FocusedItem.Index].SubItems[3].Text); DefaultSaleOrder bd1 = new DefaultSaleOrder(this, master, LVFO.Items[LVFO.FocusedItem.Index].SubItems[3].Text); SalePurchaseOrderSimpleformate bd2 = new SalePurchaseOrderSimpleformate(this, master, LVFO.Items[LVFO.FocusedItem.Index].SubItems[3].Text); Stockinout bd3 = new Stockinout(this, master, LVFO.Items[LVFO.FocusedItem.Index].SubItems[3].Text); // Sale p = new Sale(this, master, tabControl); string[] a = new string[LVFO.CheckedItems.Count]; string[] b = new string[LVFO.CheckedItems.Count]; string[] c = new string[LVFO.CheckedItems.Count]; for (int i = 0, j = 0; i < LVFO.Items.Count; i++) { //if (LVFO.Items[i].Checked == true) //{ if (Convert.ToBoolean(LVFO.Items[i].Checked) == true) { lvid = LVFO.Items[i].SubItems[8].Text; lvid1 = LVFO.Items[i].SubItems[1].Text; type = LVFO.Items[i].SubItems[3].Text; clientid = Convert.ToInt32(LVFO.Items[i].SubItems[7].Text); a[j] = lvid; b[j] = type; c[j] = lvid1; j++; } } if (dt1.Rows[0]["formname"].ToString() == bd.Text) { defaultSale.getdata(a, a, clientid, b, c); // master.AddNewTab(bd); } else if (dt1.Rows[0]["formname"].ToString() == bd1.Text) { defaultSaleOrder.getdata(a, a, clientid, b, c); } else if (dt1.Rows[0]["formname"].ToString() == bd2.Text) { salePurchaseOrderSimpleformate.getdata(a, a, clientid, b, c); } else if (dt1.Rows[0]["formname"].ToString() == bd3.Text) { stockinout.getdata(a, a, clientid, b, c); } //else if (dt1.Rows[0]["formname"].ToString() == p.Text) //{ // // p.updatemode(str, LVFO.Items[LVFO.FocusedItem.Index].SubItems[1].Text, 1); // // master.AddNewTab(p); //} }