/// <summary> /// Action for get detail of a Problem /// </summary> /// <param name="id">id of a problem for which detail needs to be get</param> /// <returns></returns> public ActionResult ProblemDetail(int id) { ViewBag.ActiveMenu = "LiMyProblems"; ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); ProblemEngine probEngine = new ProblemEngine(); ProblemObject problemobj = new ProblemObject(); string response = probEngine.GetProblemDetailsByIdJSON(Request.Cookies["sessionkey"].Value, id.ToString(), false); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if (responseObject.ResultCode == "SUCCESS" && !string.IsNullOrEmpty(responseObject.ResultObjectJSON)) problemobj = (ProblemObject)Serializer.JSONStringToObject<ProblemObject>(responseObject.ResultObjectJSON); else { Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Info; alert.Message = responseObject.ResultMessage; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.OnlyText; } ViewBag.QuotesNextPageIndex = 2; ViewBag.QuotesPageSize = QuotesPageSize; return View(problemobj); //UserProblemDetailComplexViewModel model = new UserProblemDetailComplexViewModel(); //model.ProblemViewModel.ID = 1; //model.ProblemViewModel.UserID = 1; //model.ProblemViewModel.ProblemHeading = "Washing maching balancing Problem"; //model.ProblemViewModel.Description = "Washing machine won’t spin or agitate? Not draining, filling or leaks water? This video provides information on how a washing cloths. Washer not spinning or draining? This demonstrates how to test a three terminal switch on a washing machine. The lid switch not works."; //model.ProblemViewModel.CompanyRelated = true; //model.ProblemViewModel.CompanyID = 1; //model.ProblemViewModel.CompanyName = "ProbFox pvt Ltd."; //model.ProblemViewModel.CategoryID = 1; //model.ProblemViewModel.SubCategoryID = 3; //model.ProblemViewModel.CategoryName = "Electronics"; //model.ProblemViewModel.SubCategoryName = "Motor"; //model.ProblemViewModel.ProductID = 1; //model.ProblemViewModel.ProductName = "Washing Machine"; //model.ProblemViewModel.ModelNo = "Prob-Ind-2106"; //model.ProblemViewModel.ProductStatusID = 2; //model.ProblemViewModel.ProductStatusName = "In Warranty"; //model.ProblemViewModel.PurchaseMonth = "November"; //model.ProblemViewModel.PurchaseYear = "2015"; //model.ProblemViewModel.ResolutionNeededBy = DateTime.Now; //model.ProblemViewModel.CreatedDate = DateTime.Now; //model.ProblemViewModel.UpdatedDate = DateTime.Now; //model.ProblemLocationViewModel.ID = 1; //model.ProblemLocationViewModel.ProblemID = 1; //model.ProblemLocationViewModel.Address1 = "Shiv Shakti Nager"; //model.ProblemLocationViewModel.Address2 = "Adajan"; //model.ProblemLocationViewModel.Address3 = ""; //model.ProblemLocationViewModel.City = "Ahmedabad"; //model.ProblemLocationViewModel.StateID = 1; //model.ProblemLocationViewModel.StateName = "Gujarat"; //model.ProblemLocationViewModel.CountryID = 1; //model.ProblemLocationViewModel.CountryName = "India"; //model.ProblemLocationViewModel.Pincode = "395006"; //model.ProblemLocationViewModel.Latitude = 21.192786M; //model.ProblemLocationViewModel.Longitude = 72.799809M; //ProblemMediaViewModel problemMediaViewModel = null; //for (int i = 1; i < 5; i++) //{ // problemMediaViewModel = new ProblemMediaViewModel(); // problemMediaViewModel.ID = i; // problemMediaViewModel.ProblemID = 1; // problemMediaViewModel.IsImage = true; // problemMediaViewModel.MediaPath = ServerSettings.WebApplicationURL + "/upload/problem-image/" + i.ToString() + ".JPG"; // model.ProblemMediaViewModelList.Add(problemMediaViewModel); //} //for (int i = 5; i < 7; i++) //{ // problemMediaViewModel = new ProblemMediaViewModel(); // problemMediaViewModel.ID = i; // problemMediaViewModel.ProblemID = 1; // problemMediaViewModel.IsImage = false; // problemMediaViewModel.MediaPath = ServerSettings.WebApplicationURL + "/upload/video/robotic.mp4"; // model.ProblemMediaViewModelList.Add(problemMediaViewModel); //} //ProblemHashTagsViewModel problemHashTagsViewModel = null; //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 1; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Washing machine"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 2; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Electronic Items"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 3; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "elctronic"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 4; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Motor Problem"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 5; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Expert needed"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 6; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "videocon"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 7; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "videocon machine"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //BidSummaryListViewModel bidSummaryListViewModel = null; //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 1; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 1; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/CharlesProfilePicture1.jpg"; //bidSummaryListViewModel.FirstName = "Charles"; //bidSummaryListViewModel.LastName = "Brown"; //bidSummaryListViewModel.ResolutionDescription = "Having good experice of working with electronics"; //bidSummaryListViewModel.IsSelected = true; //bidSummaryListViewModel.IsRated = true; //bidSummaryListViewModel.UserRating = 4; //bidSummaryListViewModel.IsInvited = true; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 300M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 33.36M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 21.213443M; //bidSummaryListViewModel.Longitude = 72.796905M; //bidSummaryListViewModel.BidID = 6542; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.InvitedBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.SelectedBidSummaryListViewModel.Add(bidSummaryListViewModel); //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 2; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 2; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/images.jpg"; //bidSummaryListViewModel.FirstName = "Brendon"; //bidSummaryListViewModel.LastName = "Taylor"; //bidSummaryListViewModel.ResolutionDescription = "Gradute from IIT Kanpur and passion is about electronic"; //bidSummaryListViewModel.IsSelected = true; //bidSummaryListViewModel.IsRated = true; //bidSummaryListViewModel.UserRating = 3; //bidSummaryListViewModel.IsInvited = false; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 500M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 89.13M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 12.971599M; //bidSummaryListViewModel.Longitude = 77.594563M; //bidSummaryListViewModel.BidID = 4850; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.SelectedBidSummaryListViewModel.Add(bidSummaryListViewModel); //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 3; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 3; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/enlarged-facebook-profile-picture.jpg"; //bidSummaryListViewModel.FirstName = "Jesica"; //bidSummaryListViewModel.LastName = "Martin"; //bidSummaryListViewModel.ResolutionDescription = "Having experience of working with Sharp Technology for 2 years"; //bidSummaryListViewModel.IsSelected = false; //bidSummaryListViewModel.IsRated = false; //bidSummaryListViewModel.UserRating = 0; //bidSummaryListViewModel.IsInvited = true; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 350M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 63.36M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 18.52043M; //bidSummaryListViewModel.Longitude = 73.856744M; //bidSummaryListViewModel.BidID = 7845; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.InvitedBidSummaryListViewModel.Add(bidSummaryListViewModel); //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 4; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 4; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/profile.jpg"; //bidSummaryListViewModel.FirstName = "Nathen"; //bidSummaryListViewModel.LastName = "Astle"; //bidSummaryListViewModel.ResolutionDescription = "Solve more then 2500 Problems"; //bidSummaryListViewModel.IsSelected = false; //bidSummaryListViewModel.IsRated = true; //bidSummaryListViewModel.UserRating = 4; //bidSummaryListViewModel.IsInvited = false; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 300M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 33.36M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 23.022505M; //bidSummaryListViewModel.Longitude = 72.571362M; //bidSummaryListViewModel.BidID = 2854; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //ViewBag.QuotesNextPageIndex = 2; //ViewBag.QuotesPageSize = QuotesPageSize; //return View(model); }
public ActionResult SaveCard(UserCard model) { UserEngine userEngine = new UserEngine(); string response = userEngine.UpdateCardDetailsByUserIdJSON(Request.Cookies["sessionkey"].Value, model.CardType, model.CardNumber); ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if (responseObject.ResultCode == "SUCCESS") { ProbFox.Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Success; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.TextWithClose; alert.Message = response; ViewBag.Alert = alert; } return View(); }
public ActionResult CreateProblem(Problem model, FormCollection form) { var experts = Request.Form["UserSuggestedExperts"]; var tags = Request.Form["Tag"]; HttpFileCollectionBase files = Request.Files; ProblemEngine probEngine = new ProblemEngine(); ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); CreateProblemObject complexmodel = new CreateProblemObject(); GetInitialDropDowns(complexmodel); int count = 0; int actualcount = 0; int problemid = 0; string[] filePaths = new string[Request.Files.Count]; string[] fileExtns = new string[Request.Files.Count]; if (form["ResolutionMethod"] == "Yes") form["ResolutionMethod"] = "true"; else form["ResolutionMethod"] = "false"; if (form["RegisteredAddress"] == "Yes") form["RegisteredAddress"] = "true"; else form["RegisteredAddress"] = "false"; string resultmessage = ""; if (files.Count > 0) { foreach (string file in Request.Files) { HttpPostedFileBase hpf = Request.Files[count] as HttpPostedFileBase; if (hpf.ContentLength > 0) { string newFileName = Guid.NewGuid().ToString() + "_" + hpf.FileName.Replace(" ", "_"); string relativePath = @"~\upload\problem-image\" + newFileName; hpf.SaveAs(Server.MapPath(relativePath)); filePaths[actualcount] = ConfigurationManager.AppSettings["ApplicationURL"] + ConfigurationManager.AppSettings["problemimage"] + newFileName; if (newFileName.ToLower().Contains("gif") || newFileName.ToLower().Contains("png") || newFileName.ToLower().Contains("jpg") || newFileName.ToLower().Contains("jpeg")) fileExtns[actualcount] = "image"; else fileExtns[actualcount] = "video"; actualcount++; } count++; } } string response = probEngine.SaveProblemJSON(Request.Cookies["sessionkey"].Value, null, form["CompanyRelated"], form["CompanyID"], form["ProblemHeading"], form["CategoryID"], form["SubCategory"], form["Product"], form["ModelNo"], form["Description"], form["PurchaseMonth"], form["PurchaseYear"], form["ProductStatusID"], form["ResolutionNeededBy"], form["Tag"], form["ResolutionMethod"], form["RegisteredAddress"], form["AddressLine1"], form["AddressLine2"], form["AddressLine3"], form["City"], form["State"], form["Country"], form["Pincode"]); if (!string.IsNullOrEmpty(response)) { responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); } problemid = responseObject.ResultObjectID; bool isValid = false; if(responseObject.ResultCode == "SUCCESS") { isValid = true; resultmessage = responseObject.ResultMessage; for (int fileCt = 0; fileCt < actualcount; fileCt++) { if(filePaths[fileCt] != string.Empty) { response = ""; if(fileCt == 0) response = probEngine.SaveMedia(Request.Cookies["sessionkey"].Value, responseObject.ResultObjectID.ToString(), filePaths[fileCt], fileExtns[fileCt], true); else response = probEngine.SaveMedia(Request.Cookies["sessionkey"].Value, responseObject.ResultObjectID.ToString(), filePaths[fileCt], fileExtns[fileCt], false); } } responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if(responseObject.ResultCode == "SUCCESS") { if(experts.Count() > 0) { response = probEngine.InviteExpertsJSON(Request.Cookies["sessionkey"].Value, problemid.ToString(), experts); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if(responseObject.ResultCode == "SUCCESS") { isValid = true; } } } else { isValid = false; } } else { isValid = false; } if(!isValid) { Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Error; alert.Message = responseObject.ResultMessage; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.OnlyText; ViewBag.AlertMessageModel = alert; } else { Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Success; alert.Message = responseObject.ResultMessage; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.TextWithClose; ViewBag.AlertMessageModel = alert; } //if (!string.IsNullOrEmpty(model.VideoStremName1)) //{ // string DirectoryName = ServerSettings.VideoStoragePhysicalFolderPath; // int status = Mapping.ConvertToMp4(ServerSettings.MEDIASERVERURL, model.VideoStremName1 + ".flv", DirectoryName, model.VideoStremName1 + ".mp4"); //} //if (!string.IsNullOrEmpty(model.VideoStremName2)) //{ // string DirectoryName = ServerSettings.VideoStoragePhysicalFolderPath; // int status = Mapping.ConvertToMp4(ServerSettings.MEDIASERVERURL, model.VideoStremName2 + ".flv", DirectoryName, model.VideoStremName2 + ".mp4"); //} return View(complexmodel); }
/// <summary> /// Action for change the password of login user /// </summary> /// <param name="pCurrentPassword">current password of a login user</param> /// <param name="pNewPassword">new password that needs to be set for user</param> /// <returns></returns> public ActionResult ChangePassword(string pCurrentPassword, string pNewPassword) { MyProfileObject model = new MyProfileObject(); AuthenticationEngine authEngine = new AuthenticationEngine(); string response = authEngine.ChangePassword(Request.Cookies["sessionkey"].Value, pCurrentPassword, pNewPassword); ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if (responseObject.ResultCode == "SUCCESS") { ProbFox.Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Success; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.TextWithClose; alert.Message = response; ViewBag.Alert = alert; } return View(); }
/// <summary> /// Save contact detail /// </summary> /// <returns></returns> public ActionResult SaveContactDetail(FormCollection form) { MyProfileObject model = new MyProfileObject(); UserEngine userEngine = new UserEngine(); string response = userEngine.UpdateContactInfoByUserIdJSON(Request.Cookies["sessionkey"].Value, form["Address1"], form["Address2"], form["Address3"], form["City"], form["StateID"], form["CountryID"], form["PinCode"]); ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if (responseObject.ResultCode == "SUCCESS") { ProbFox.Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Success; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.TextWithClose; alert.Message = response; ViewBag.Alert = alert; } return View(); }
public ActionResult MyProfile(FormCollection form) { MyProfileObject model = new MyProfileObject(); if(form["IsUser"] == "Yes") { form["IsUser"] = "******"; form["IsExpert"] = "false"; } UserEngine userEngine = new UserEngine(); string response = userEngine.UpdatePersonalInfoByUserIdJSON(Request.Cookies["sessionkey"].Value, form["FirstName"], form["LastName"], form["DisplayName"], form["IsUser"], form["isExpert"], form["hdfCategoryJSON"], form["BriefDescription"], form["PhoneNumber"]); ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if(responseObject.ResultCode == "SUCCESS") { ProbFox.Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Success; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.TextWithClose; alert.Message = response; ViewBag.Alert = alert; return View(model); } //List<UserCard_XREF> cardModelList = new List<UserCard_XREF>(); //UserCard_XREF cardModel = new UserCard_XREF(); //cardModel.ID = 1; //cardModel.UserID = UserSession.LoginUserID; //cardModel.CardNumber = "123455"; //cardModel.CardType = "Visa"; //cardModelList.Add(cardModel); //cardModel = new UserCard_XREF(); //cardModel.ID = 2; //cardModel.UserID = UserSession.LoginUserID; //cardModel.CardNumber = "XXX458"; //cardModel.CardType = "Credit"; //cardModelList.Add(cardModel); //cardModel = new UserCard_XREF(); //cardModel.ID = 3; //cardModel.UserID = UserSession.LoginUserID; //cardModel.CardNumber = "123"; //cardModel.CardType = "Debit"; //cardModelList.Add(cardModel); //model.UserCardModelList = cardModelList; //GetInitialDropDownComplexModel(model); //model.UserViewModel.FirstName = "John"; //model.UserViewModel.LastName = "Smith"; //model.UserViewModel.DisplayName = "John Smith"; //model.UserViewModel.EmailID = "*****@*****.**"; //model.UserViewModel.ProfilePicPath = ServerSettings.WebApplicationURL + "/upload/profilepic/profile.jpg"; //model.UserViewModel.BriefDescription = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."; //model.UserViewModel.PhoneNumber = "1234567890"; //model.UserViewModel.PinCode = "395009"; //model.UserViewModel.Address1 = "b-123/tulsikunj soc"; //model.UserViewModel.Address2 = "Bh. Viabhav Hall,Ghodasar"; //model.UserViewModel.Address3 = "Maninagar"; //model.UserViewModel.City = "Ahmedabad"; //if (UserSession.LoginUserType == USERTYPE.Expert.ToString()) //{ // SelectedCategoriesViewModel selectedCategoryModel = null; // List<SubCategory> subcategoryList = new List<SubCategory>(); // subcategoryList.Add(new SubCategory { Name = "Tv", ID = 1 }); // subcategoryList.Add(new SubCategory { Name = "Freez", ID = 2 }); // subcategoryList.Add(new SubCategory { Name = "AC", ID = 3 }); // selectedCategoryModel = new SelectedCategoriesViewModel(); // selectedCategoryModel.CategoryID = 1; // selectedCategoryModel.SubCategoryList = subcategoryList; // selectedCategoryModel.SelectedSubCategories = "1,3"; // model.SelectedCategoriesViewModelList.Add(selectedCategoryModel); // selectedCategoryModel = new SelectedCategoriesViewModel(); // selectedCategoryModel.CategoryID = 2; // selectedCategoryModel.SubCategoryList = subcategoryList; // selectedCategoryModel.SelectedSubCategories = "3"; // model.SelectedCategoriesViewModelList.Add(selectedCategoryModel); //} return View(model); }
public ActionResult Login(FormCollection form) { string response = CreateSession(form["Email"], form["Password"]); if (response == "Expert") return RedirectToAction("Problem", "Expert"); else if (response == "User") 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 = response; ViewBag.Alert = alert; return View(); } }
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(); } }