Ejemplo n.º 1
0
        public void GetInitialDropDowns(CreateProblemObject createproblemobj)
        {
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            MasterlistEngine masterEngine = new MasterlistEngine();
            string response = masterEngine.GetDropDownItemsJSON(Request.Cookies["sessionkey"].Value);
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            createproblemobj = (CreateProblemObject)Serializer.JSONStringToObject<CreateProblemObject>(responseObject.ResultObjectJSON);
            ViewBag.Country = new SelectList(createproblemobj.countries, "CountryID", "CountryName");
            ViewBag.CompanyID = new SelectList(createproblemobj.companies, "CompanyID", "CompanyName");
            ViewBag.CategoryID = new SelectList(createproblemobj.categories, "ID", "Name");
            ViewBag.ProductStatusID = new SelectList(createproblemobj.productstatuses, "ProductStatusID", "ProductStatusName");
            ViewBag.PinCode = createproblemobj.PinCode;
            //List<DropDownViewModel> categoryList = new List<DropDownViewModel>();
            //categoryList.Add(new DropDownViewModel { Name = "Electronics", ID = 1 });
            //categoryList.Add(new DropDownViewModel { Name = "Furniture", ID = 2 });
            //model.CategoryList = categoryList;
            ////ViewBag.CategoryId = new SelectList(model.CategoryList, "ID", "Name"); ;

            //List<DropDownViewModel> companyList = new List<DropDownViewModel>();
            //companyList.Add(new DropDownViewModel { Name = "Google", ID = 1 });
            //companyList.Add(new DropDownViewModel { Name = "Yahoo", ID = 2 });
            //companyList.Add(new DropDownViewModel { Name = "Facebook", ID = 3 });
            //companyList.Add(new DropDownViewModel { Name = "Microsoft", ID = 4 });
            //companyList.Add(new DropDownViewModel { Name = "Intel", ID = 5 });
            //model.CompanyList = companyList;

            //List<DropDownViewModel> statusList = new List<DropDownViewModel>();
            //statusList.Add(new DropDownViewModel { Name = "In Warranty", ID = 1 });
            //statusList.Add(new DropDownViewModel { Name = "In Guaranty", ID = 2 });
            //model.ProductStatusList = statusList;

            //List<DropDownViewModel> countryList = new List<DropDownViewModel>();
            //countryList.Add(new DropDownViewModel { Name = "India", ID = 1 });
            //countryList.Add(new DropDownViewModel { Name = "Australia", ID = 2 });
            //countryList.Add(new DropDownViewModel { Name = "New Zealand", ID = 3 });
            //countryList.Add(new DropDownViewModel { Name = "Canada", ID = 4 });
            //model.CountryList = countryList;
        }