private String GenerateReturnString()
        {
            try
            {
                String mode = HttpContext.Current.Request.QueryString["mode"];
                String thisval = "";
                ItemMasterManager manager1 = new ItemMasterManager();
                switch (mode)
                {
                    case "onSelectMode_SubGroup":
                        thisval = HttpContext.Current.Request.QueryString["thisval"];
                        ItemSubGroupManager manager = new ItemSubGroupManager();
                        CustomList<ItemSubGroup> SubGroupList = (CustomList<ItemSubGroup>)HttpContext.Current.Session["ItemRequisition_ItemSubGroupList"];
                        return MakeStringSubGroup(SubGroupList.FindAll(f=>f.ItemGroupID==Convert.ToInt32(thisval)));
                    case "onSelectMode_Item":
                        thisval = HttpContext.Current.Request.QueryString["thisval"];
                        CustomList<ItemMaster> ItemMasterList = (CustomList<ItemMaster>)HttpContext.Current.Session["ItemRequisition_ItemMasterList"];
                        return MakeStringItem(ItemMasterList.FindAll(f => f.ItemGroupID == Convert.ToInt32(thisval)));
                    case "onSelectMode_ItemBySubGroup":
                        thisval = HttpContext.Current.Request.QueryString["thisval"];
                        CustomList<ItemMaster> ItemMasterList1 = (CustomList<ItemMaster>)HttpContext.Current.Session["ItemRequisition_ItemMasterList"];;
                        return MakeStringItem(ItemMasterList1.FindAll(f => f.ItemSubGroupID == Convert.ToInt32(thisval)));

                    case "onSelectMode_SubGroupStock":
                        thisval = HttpContext.Current.Request.QueryString["thisval"];
                        ItemSubGroupManager managerStock = new ItemSubGroupManager();
                        CustomList<ItemSubGroup> SubGroupListStock = (CustomList<ItemSubGroup>)HttpContext.Current.Session["StockTransaction_ItemSubGroupList"];
                        return MakeStringSubGroup(SubGroupListStock.FindAll(f => f.ItemGroupID == Convert.ToInt32(thisval)));
                    case "onSelectMode_ItemStock":
                        thisval = HttpContext.Current.Request.QueryString["thisval"];
                        CustomList<ItemMaster> ItemMasterListStock = (CustomList<ItemMaster>)HttpContext.Current.Session["StockTransaction_ItemMasterList"];
                        return MakeStringItem(ItemMasterListStock.FindAll(f => f.ItemGroupID == Convert.ToInt32(thisval)));
                    case "onSelectMode_ItemBySubGroupStock":
                        thisval = HttpContext.Current.Request.QueryString["thisval"];
                        CustomList<ItemMaster> ItemMasterList1Stock = (CustomList<ItemMaster>)HttpContext.Current.Session["StockTransaction_ItemMasterList"]; ;
                        return MakeStringItem(ItemMasterList1Stock.FindAll(f => f.ItemSubGroupID == Convert.ToInt32(thisval)));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return "";
        }
        private void InitializeSession()
        {
            try
            {
                GroupItemManager GIManager = new GroupItemManager();
                ItemSubGroupManager SGManager = new ItemSubGroupManager();
                ItemMasterManager IMManager = new ItemMasterManager();
                UnitSetupManager USManager = new UnitSetupManager();

                ItemGroupList = new CustomList<ItemGroup>();
                //ItemGroupList = GIManager.DeptWiseItemGroup(41);
                ItemSubGroupList = new CustomList<ItemSubGroup>();
                ItemSubGroupList = SGManager.GetAllItemSubGroup();
                ItemMasterList = new CustomList<ItemMaster>();
                ItemMasterList = IMManager.FindAllItemMasterGroupWise();

                StockTransactionDetailList = new CustomList<StockTransactionDetail>();
                UnitSetupList = new CustomList<UnitSetup>();
                UnitSetupList = USManager.GetAllUnitSetup();
                StockTransactionMasterList = new CustomList<StockTransactionMaster>();
            }
            catch (Exception ex)
            {

                throw (ex);
            }
        }