Ejemplo n.º 1
0
 public JsonResult BindSubCategoryFromCategoryIDs(string pCategoryIDs)
 {
     ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
     MasterlistEngine masterEngine = new MasterlistEngine();
     string response = masterEngine.GetSubCatsbyCategoriesJSON(Request.Cookies["sessionkey"].Value, pCategoryIDs);
     responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
     List<Common.DTO.Product> products = new List<Common.DTO.Product>();
     products = (List<Common.DTO.Product>)Serializer.JSONStringToObject<List<Common.DTO.Product>>(responseObject.ResultObjectJSON);
     return Json(products, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Action for Bind SubCategory From CategoryID
 /// </summary>
 /// <param name="pCategoryID">Id of a category for which sub category needs to be searched</param>
 /// <returns></returns>
 public JsonResult BindSubCategory(int pCategoryID)
 {
     ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
     MasterlistEngine masterEngine = new MasterlistEngine();
     string response = masterEngine.GetSubCategoryListJSON(pCategoryID.ToString());
     responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
     List<Common.DTO.SubCategory> subcategories = new List<Common.DTO.SubCategory>();
     subcategories = (List<Common.DTO.SubCategory>)Serializer.JSONStringToObject<List<Common.DTO.SubCategory>>(responseObject.ResultObjectJSON);
     return Json(subcategories, JsonRequestBehavior.AllowGet);
 }
Ejemplo n.º 3
0
        public ActionResult SignUp()
        {
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            MasterlistEngine masterEngine = new MasterlistEngine();
            string response = masterEngine.GetCategoryListJSON();
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            List<Common.DTO.Category> categories = new List<Common.DTO.Category>();
            categories = (List<Common.DTO.Category>)Serializer.JSONStringToObject<List<Common.DTO.Category>>(responseObject.ResultObjectJSON);
            ViewBag.CategoryId = new SelectList(categories, "ID", "Name");

            return View();
        }
Ejemplo n.º 4
0
 public ActionResult CompanyProfile(int id)
 {
     List<Company> lstcompany = new List<Company>();
     ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
     MasterlistEngine masterEngine = new MasterlistEngine();
     string response = masterEngine.GetCompanyListJSON(Request.Cookies["sessionkey"].Value);
     responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
     lstcompany = (List<Company>)Serializer.JSONStringToObject<List<Company>>(responseObject.ResultObjectJSON);
     return PartialView("_CompanyProfile", lstcompany);
     //CompanyProfileComplexModel model = new CompanyProfileComplexModel();
     //model.CompanyId = 1;
     //model.CompanyLogo = "~/assets/img/walmart.png";
     //model.CompanyName = "WallMart Group Inc.";
     //model.Description = " Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.";
     //model.CompanySupportWeekdaysStartTime = "09:00 AM";
     //model.CompanySupportWeekdaysEndTime = "06:00 PM";
     //model.CompanySupportWeekendsEndTime = "06:00 AM";
     //model.CompanySupportWeekendsStartTime = "09:00 AM";
     //model.Address1 = "WalMart Inc.";
     //model.Address2 = "795 Park Ave, Suite 120";
     //model.Address3 = "Dalal Street";
     //model.City = "Texas";
     //model.StateName = "Texas Repulic";
     //model.PinCode = "94107";
     //model.CompanyEmail = "*****@*****.**";
     //model.CompanyPhone = "000-666-444";
     //model.Latitude = Convert.ToDecimal(76.1111111);
     //model.Longitude = Convert.ToDecimal(76.1111111);
     //return PartialView("_CompanyProfile", model);
 }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
0
        public void GetInitialDropDownComplexModel(MyProfileObject model)
        {
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            MasterlistEngine masterEngine = new MasterlistEngine();
            string response = masterEngine.GetCategoryListJSON();
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            List<Common.DTO.Category> categories = new List<Common.DTO.Category>();
            categories = (List<Common.DTO.Category>)Serializer.JSONStringToObject<List<Common.DTO.Category>>(responseObject.ResultObjectJSON);

            model.Categories = categories;
            ViewBag.CategoryId = new SelectList(categories, "ID", "Name"); ;
            response = string.Empty;
            response = masterEngine.GetCountryListJSON();
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            List<Common.DTO.Country> countries = new List<Common.DTO.Country>();
            countries = (List<Common.DTO.Country>)Serializer.JSONStringToObject<List<Common.DTO.Country>>(responseObject.ResultObjectJSON);

            model.Countries = countries;
        }
Ejemplo n.º 7
0
 public ActionResult SignUp(FormCollection form)
 {
     string categoryJson = form["hdfSelectedCategoryJson"];
     UserEngine userEngine = new UserEngine();
     MasterlistEngine masterEngine = new MasterlistEngine();
     if(form["hdnIsUser"] == "" && form["hdnIsExpert"] == "")
     {
         form["hdnIsUser"] = "******";
         form["hdnIsExpert"] = "false";
     }
     string response = userEngine.CreateUserJSON(form["FirstName"], form["LastName"], form["DisplayName"], form["Email"], form["Address"], form["City"], form["PinCode"],
                                                 form["hdnIsUser"], form["hdnIsExpert"], categoryJson, form["Password"], Request.ServerVariables["REMOTE_ADDR"]);
     ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
     if (!string.IsNullOrEmpty(response)) { responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); }
     if(responseObject.ResultCode == "SUCCESS")
     {
         string role = CreateSession(form["Email"], form["Password"]);
         if(role == "Expert")
             return RedirectToAction("Problem", "Expert");
         else
             return RedirectToAction("Problem", "User");
     }
     else
     {
         ProbFox.Common.DTO.Alert alert = new Common.DTO.Alert();
         alert.AlertType = Common.DTO.Alert.ALERTTYPE.Error;
         alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.TextWithClose;
         alert.Message = responseObject.ResultMessage;
         ViewBag.Alert = alert;
         response = masterEngine.GetCategoryListJSON();
         responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
         List<Common.DTO.Category> categories = new List<Common.DTO.Category>();
         categories = (List<Common.DTO.Category>)Serializer.JSONStringToObject<List<Common.DTO.Category>>(responseObject.ResultObjectJSON);
         ViewBag.CategoryId = new SelectList(categories, "ID", "Name"); ;
         return View();
     }
 }