Ejemplo n.º 1
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.º 2
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.º 3
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();
     }
 }