public ActionResult GetfilteredAds(string State, string District, string Mandal, string CategoryId, string Keyword) { int TotalPageNumber = 0; InformationServiceWrapper objservice = new InformationServiceWrapper(); DropDownWrapperModel ModelObj = new DropDownWrapperModel(); ModelObj = objservice.GetDropDownValues(); ViewBag.DistrictLIst = ModelObj.District; ViewBag.MandalList = ModelObj.Mandal; AdFilterModel Model = new AdFilterModel(); Model.txtState = State == ""?null:State; // form["ddlStateText"]; Model.txtDistrict = District == "" ? null : District;; //form["ddlDistrict"]; Model.txtMandal = Mandal == "" ? null :Mandal; // form["ddlMandal"]; Model.CategoryId = Convert.ToInt32(CategoryId); //Convert.ToInt32(form["ddlCategory"]); Model.TxtKeyWord = Keyword == "" ? null :Keyword; //form["txtSearchWord"]; List <AdDetailsModel> LisModelObj = new List <AdDetailsModel>(); LisModelObj = objservice.GetfilteredAds(Model, out TotalPageNumber); ViewBag.Adlist = LisModelObj; ViewBag.TotalPageNumber = TotalPageNumber; return(View("FilteredAds")); }
public ActionResult AdDetails(int AdId) { HttpCookie nameCookie = Request.Cookies["_RRAUN"]; if (nameCookie != null) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); model = objservice.FetchAdDetails(AdId); ViewBag.AdId = model.AdID; //ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.SubCategoryName = model.txtSubCategoryName; ViewBag.Category = model.Category; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; return(View()); } else { return(RedirectToAction("Login", "Admin")); } }
public ActionResult AdManagement(int PageNumber) { HttpCookie nameCookie = Request.Cookies["_RRAUN"]; InformationServiceWrapper objservice = new InformationServiceWrapper(); DropDownWrapperModel ModelObj = new DropDownWrapperModel(); ModelObj = objservice.GetDropDownValues(); ViewBag.DistrictLIst = ModelObj.District; ViewBag.MandalList = ModelObj.Mandal; if (nameCookie != null) { int TotalPageNumber = 0; ViewBag.CurrentPageNumber = PageNumber; List <AdDetailsModel> AdList = new List <AdDetailsModel>(); InformationServiceWrapper Obj = new InformationServiceWrapper(); AdList = Obj.FetAdDetailsForAdminPageVerifiedAds(PageNumber, out TotalPageNumber); ViewBag.Adlist = AdList; ViewBag.TotalPageNumber = TotalPageNumber; return(View("AdManagement")); } else { return(RedirectToAction("AdminLogin", "Admin")); } }
public ActionResult UpdateOTP(Int64 PhoneNumber) { int otp; Utility en = new Utility(); UserDetailsModel objModel = new UserDetailsModel(); objModel.txtPhoneNumber = PhoneNumber; ManagementServiceWrapper ObjService = new ManagementServiceWrapper(); InformationServiceWrapper infoObj = new InformationServiceWrapper(); GDictionaryModel GDOBJ = new GDictionaryModel(); GDOBJ = infoObj.MobileNumberVerification(PhoneNumber); if (GDOBJ.ID == 0) { otp = ObjService.UpdateOtp(objModel); HttpCookie OTPCookie = new HttpCookie("_ROTP_"); OTPCookie.Values["_ROTP_"] = en.Encrypt(otp.ToString()); OTPCookie.Expires = DateTime.Now.AddMinutes(30); Response.Cookies.Add(OTPCookie); return(Json(1, JsonRequestBehavior.AllowGet)); } else { return(Json(0, JsonRequestBehavior.AllowGet)); } }
public ActionResult _AdSearch(string State, string District, string DistrictId, string Mandal, string MandalId, string CategoryId, Int32 PageNumber) { int TotalPageNumber = 0; ViewBag.CurrentPageNumber = PageNumber; InformationServiceWrapper objservice = new InformationServiceWrapper(); AdFilterModel Model = new AdFilterModel(); Model.txtState = State == "" ? null : State; //form["ddlStateText"]; Model.txtDistrict = District == "" ? null : District; //form["ddlDistrict"]; Model.txtMandal = Mandal == "" ? null : Mandal; //form["ddlMandal"]; Model.CategoryId = Convert.ToInt32(CategoryId); //form["ddlCategory"]; // Model.TxtKeyWord = Keyword == "" ? null : Keyword; //form["txtSearchWord"]; Model.INTPAGENUMBER = PageNumber; Model.INTPAGESIZE = 10; List <AdDetailsModel> LisModelObj = new List <AdDetailsModel>(); LisModelObj = objservice.GetfilteredAds(Model, out TotalPageNumber); ViewBag.Adlist = LisModelObj; ViewBag.TotalPageNumber = TotalPageNumber; @ViewBag.CategoryId = Model.CategoryId; @ViewBag.selectedState = Model.txtState; @ViewBag.SelectedDistrictId = DistrictId; @ViewBag.selectedMandalId = MandalId; return(PartialView("AdSearch")); }
public ActionResult AdSearch(int CategoryId, int PageNumber) { ViewBag.CategoryId = CategoryId; int outTotalPageNumber = 0; ViewBag.CurrentPageNumber = PageNumber; InformationServiceWrapper objservice = new InformationServiceWrapper(); List <AdDetailsModel> LisModelObj = new List <AdDetailsModel>(); LisModelObj = objservice.SPRRGetADbyCategory(CategoryId, PageNumber, out outTotalPageNumber); foreach (AdDetailsModel item in LisModelObj) { if (item.Category == "Fruit" || item.Category == "Handloom" || item.Category == "Equipment" || item.Category == "Vegetable" || item.Category == "Others") { item.Category = item.txtSubCategoryName; } } ViewBag.TotalPageNumber = outTotalPageNumber; ViewBag.Adlist = LisModelObj; ViewBag.SearchData = CategoryId; return(View("AdSearch")); }
public ActionResult RetrieveImage(int AdId) { HttpCookie UserIdCookie = Request.Cookies["_RRUID"]; Utility en = new Utility(); if (UserIdCookie != null) { AdDetailsModel ModelINPUT = new AdDetailsModel(); AdDetailsModel ModelOut = new AdDetailsModel(); ModelINPUT.AdID = AdId; ModelINPUT.UserID = Convert.ToInt32(en.Decrypt(UserIdCookie["_RRUID"])); InformationServiceWrapper InfoObj = new InformationServiceWrapper(); ModelOut = InfoObj.GetImage(ModelINPUT); if (ModelOut != null) { return(File(ModelOut.Image, "image/jpg")); } else { return(null); } } else { return(null); } }
public ActionResult Login(FormCollection fnLogin) { Int64 PhoneNumber = Convert.ToInt64(fnLogin["txtPhoneNumber"]); Utility en = new Utility(); string PassWord = en.Encrypt(fnLogin["txtPassword"]); // string PassWord = fnLogin["txtPassword"]; InformationServiceWrapper Obj = new InformationServiceWrapper(); UserDetailsModel ModelObj = new UserDetailsModel(); ModelObj = Obj.AdminLoginCheck(PhoneNumber, PassWord); //Create a Cookie with a suitable Key. if (ModelObj.txtUserName != null) { HttpCookie UserNameCookie = new HttpCookie("_RRAUN"); HttpCookie PhoneNumberCookie = new HttpCookie("_RRAPn"); HttpCookie KeyCookie = new HttpCookie("_RRAPS"); //Set the Expiry date. UserNameCookie.Expires = DateTime.Now.AddDays(365); if (ModelObj.txtUserName.Length <= 10) { //Set the Cookie value. UserNameCookie.Values["_RRAUN"] = ModelObj.txtUserName; ViewBag.UserName = ModelObj.txtUserName; //Add the Cookie to Browser. Response.Cookies.Add(UserNameCookie); // Session["LOGGEDONUSER"] = ModelObj.txtUserName; } else { //Session["LOGGEDONUSER"] = ModelObj.txtUserName.Substring(0, 10) + ".."; UserNameCookie.Values["_RRAUN"] = ModelObj.txtUserName.Substring(0, 10) + ".."; //Add the Cookie to Browser. Response.Cookies.Add(UserNameCookie); } if (!string.IsNullOrEmpty((string)UserNameCookie.Value)) { PhoneNumberCookie["_RRAPn"] = fnLogin["txtPhoneNumber"]; KeyCookie["_RRAPS"] = PassWord; } else { ViewBag.ErrorMessage = "Please enter correct credentials"; } return(Json(Convert.ToString(UserNameCookie.Value), JsonRequestBehavior.AllowGet)); } else { return(Json("", JsonRequestBehavior.AllowGet)); } }
public ActionResult Reviews() { List <GDictionaryModel> list = new List <GDictionaryModel>(); InformationServiceWrapper InforObj = new InformationServiceWrapper(); list = InforObj.FetchReviews(); ViewBag.ReviewList = list; return(View()); }
public ActionResult Home() { InformationServiceWrapper objservice = new InformationServiceWrapper(); DropDownWrapperModel ModelObj = new DropDownWrapperModel(); ModelObj = objservice.GetDropDownValues(); ViewBag.DistrictLIst = ModelObj.District; ViewBag.MandalList = ModelObj.Mandal; return(View()); }
public ActionResult GetDropDownValues() { InformationServiceWrapper objservice = new InformationServiceWrapper(); DropDownWrapperModel ModelObj = new DropDownWrapperModel(); ModelObj = objservice.GetDropDownValues(); ViewBag.DistrictLIst = ModelObj.District; ViewBag.MandalList = ModelObj.Mandal; return(Json(1, JsonRequestBehavior.AllowGet)); }
public ActionResult Login(FormCollection fnLogin) { Int64 PhoneNumber = Convert.ToInt64(fnLogin["txtPhoneNumber"]); Utility en = new Utility(); string PassWord = en.Encrypt(fnLogin["txtPassword"]); InformationServiceWrapper Obj = new InformationServiceWrapper(); UserDetailsModel ModelObj = new UserDetailsModel(); ModelObj = Obj.GetLoginCheck(PhoneNumber, PassWord); if (ModelObj.txtUserName != null) { HttpCookie KeyCookie = new HttpCookie("_RRPS"); HttpCookie UserIdCookie = new HttpCookie("_RRUID"); HttpCookie PhoneNumberCookie = new HttpCookie("_RRUPn"); HttpCookie UserNameCookie = new HttpCookie("_RRUN"); KeyCookie.Values["_RRPS"] = en.Encrypt(PassWord); UserIdCookie.Values["_RRUID"] = en.Encrypt(ModelObj.intUserId.ToString()); PhoneNumberCookie.Values["_RRUPn"] = en.Encrypt(fnLogin["txtPhoneNumber"]); if (ModelObj.txtUserName.Length <= 10) { UserNameCookie.Values["_RRUN"] = ModelObj.txtUserName; } else { UserNameCookie.Values["_RRUN"] = ModelObj.txtUserName.Substring(0, 10) + ".."; } KeyCookie.Expires = DateTime.Now.AddDays(365); UserIdCookie.Expires = DateTime.Now.AddDays(365); PhoneNumberCookie.Expires = DateTime.Now.AddDays(365); UserNameCookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(KeyCookie); Response.Cookies.Add(UserIdCookie); Response.Cookies.Add(PhoneNumberCookie); Response.Cookies.Add(UserNameCookie); return(Json(ModelObj.txtUserName, JsonRequestBehavior.AllowGet)); } else { return(Json("", JsonRequestBehavior.AllowGet)); } }
public ActionResult _AdSearchCategory(int Category, int PageNumber) { int outTotalPageNumber = 0; ViewBag.CurrentPageNumber = PageNumber; InformationServiceWrapper objservice = new InformationServiceWrapper(); List <AdDetailsModel> LisModelObj = new List <AdDetailsModel>(); LisModelObj = objservice.SPRRGetADbyCategory(Category, PageNumber, out outTotalPageNumber); ViewBag.TotalPageNumber = outTotalPageNumber; ViewBag.Adlist = LisModelObj; ViewBag.SearchOption = "CATEGORY"; ViewBag.SearchData = Category; return(PartialView("_AdSearch")); }
public ActionResult AdDisplayWithPhoneNumber(int AdId) { HttpCookie UserIdCookie = Request.Cookies["_RRUID"]; HttpCookie PhoneNumberCookie = Request.Cookies["_RRUPn"]; if (UserIdCookie != null && PhoneNumberCookie != null) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); model = objservice.SPRRGetAdDisplayDetails(AdId); ViewBag.IntAdId = model.AdID; ViewBag.AdId = model.AdID + ".jpg"; ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.Category = model.Category; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; ViewBag.Name = model.Name; ViewBag.MobileNumber = model.MobileNuber.ToString(); ViewBag.Location = model.Location; ViewBag.AdPostedDate = model.PostedDate; if (model.Category == "Fruit" || model.Category == "Handloom" || model.Category == "Equipment" || model.Category == "Vegetable" || model.Category == "Others") { ViewBag.DefinedTitle = model.txtSubCategoryName + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } else { ViewBag.DefinedTitle = model.Category + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } ViewBag.DefinedUnit = " /" + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); ManagementServiceWrapper ManObj = new ManagementServiceWrapper(); Utility en = new Utility(); AdDetailsModel StatisticsObj = new AdDetailsModel(); StatisticsObj.UserID = Convert.ToInt32(en.Decrypt(UserIdCookie["_RRUID"])); StatisticsObj.MobileNuber = Convert.ToInt64(en.Decrypt(PhoneNumberCookie["_RRUPn"])); StatisticsObj.AdID = model.AdID;; ManObj.SPInsertAdViewsStatistics(StatisticsObj); return(View("AdDisplay")); } else { return(RedirectToAction("Login", "User")); } }
public ActionResult ContactUs() { HttpCookie nameCookie = Request.Cookies["_RRAUN"]; if (nameCookie != null) { InformationServiceWrapper inforObj = new InformationServiceWrapper(); List <ContactUsModel> ModelList = new List <ContactUsModel>(); ModelList = inforObj.FetchContactForAdmin(); ViewBag.ContactusList = ModelList; return(View()); } else { return(RedirectToAction("Login", "Admin")); } }
public ActionResult Exceptions() { HttpCookie nameCookie = Request.Cookies["_RRAUN"]; if (nameCookie != null) { InformationServiceWrapper inforObj = new InformationServiceWrapper(); List <ExceptionModel> ModelList = new List <ExceptionModel>(); ModelList = inforObj.FetchExceptionsForAdmin(); ViewBag.ExceptionList = ModelList; return(View("Exceptions")); } else { return(RedirectToAction("Login", "Admin")); } }
public ActionResult UpdatePhoneNumber(FormCollection fnRegistration) { int UserId; HttpCookie UserIdCookie = Request.Cookies["_RRUID"]; HttpCookie PhoneNumberCookie = Request.Cookies["_RRUPn"]; if (UserIdCookie != null) { GDictionaryModel GDModel = new GDictionaryModel(); UserDetailsModel objModel = new UserDetailsModel(); ManagementServiceWrapper ObjService = new ManagementServiceWrapper(); InformationServiceWrapper InfoService = new InformationServiceWrapper(); Utility en = new Utility(); objModel.intUserId = Convert.ToInt32(en.Decrypt(UserIdCookie["_RRUID"])); objModel.txtPhoneNumber = Convert.ToInt64(fnRegistration["txtPhoneNumber"]); objModel.KeyForUserSettings = Convert.ToString(UserSettings.PHONENUMBER); GDModel = InfoService.MobileNumberVerification(objModel.txtPhoneNumber); if (GDModel.ID == 0) { ViewBag.MobileError = "Entered Mobiler Number is already registered"; return(Json(0, JsonRequestBehavior.AllowGet)); } else if (GDModel.ID == 1 && Regex.Match(objModel.txtPhoneNumber.ToString(), @"^([5-9]{1}[0-9]{9})$").Success) { UserId = ObjService.UpdateUserDetails(objModel); if (UserId != 0) { PhoneNumberCookie.Values["_RRUPn"] = en.Encrypt(objModel.txtPhoneNumber.ToString()); PhoneNumberCookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(PhoneNumberCookie); } return(Json(UserId, JsonRequestBehavior.AllowGet)); } else { return(Json(-99, JsonRequestBehavior.AllowGet)); } } else { return(Json(-99, JsonRequestBehavior.AllowGet)); } }
public ActionResult VerifyUsers(int PageNumber) { HttpCookie nameCookie = Request.Cookies["_RRAUN"]; if (nameCookie != null) { int TotalPageNumber = 0; ViewBag.CurrentPageNumber = PageNumber; List <UserDetailsModel> UserList = new List <UserDetailsModel>(); InformationServiceWrapper Obj = new InformationServiceWrapper(); UserList = Obj.FetchUnverifiedUsers(PageNumber, out TotalPageNumber); ViewBag.UserList = UserList; ViewBag.TotalPageNumber = TotalPageNumber; return(View()); } else { return(RedirectToAction("Login", "Admin")); } }
//[NoCache] public ActionResult _AddList(int PageNumber) { int TotalPageNumber = 0; ViewBag.CurrentPageNumber = PageNumber; HttpCookie KeyCookie = Request.Cookies["_RRPS"]; HttpCookie UserIdCookie = Request.Cookies["_RRUID"]; HttpCookie UserNameCookie = Request.Cookies["_RRUN"]; HttpCookie PhoneNumberCookie = Request.Cookies["_RRUPn"]; HttpCookie OTPCookie = Request.Cookies["_ROTP_"]; Utility en = new Utility(); if (UserNameCookie != null && KeyCookie != null) { Int64 PhoneNumber = Convert.ToInt64(en.Decrypt(PhoneNumberCookie["_RRUPn"])); string PassWord = en.Decrypt(KeyCookie["_RRPS"].ToString()); List <AdDetailsModel> ListObj = new List <AdDetailsModel>(); InformationServiceWrapper Obj = new InformationServiceWrapper(); ListObj = Obj.GetUserAds(PhoneNumber, PassWord, PageNumber, out TotalPageNumber); if (ListObj != null) { ViewBag.AdList = ListObj; } } else if (UserNameCookie != null && OTPCookie != null) { Int64 PhoneNumber = Convert.ToInt64(en.Decrypt(PhoneNumberCookie["_RRUPn"])); Utility UtilObj = new Utility(); string OTP = UtilObj.Decrypt(OTPCookie["_ROTP_"]); List <AdDetailsModel> ListObj = new List <AdDetailsModel>(); InformationServiceWrapper Obj = new InformationServiceWrapper(); ListObj = Obj.GetUserAds(PhoneNumber, OTP, PageNumber, out TotalPageNumber); if (ListObj != null) { ViewBag.AdList = ListObj; } } ViewBag.TotalPageNumber = TotalPageNumber; return(PartialView("_AdList")); }
public ActionResult AdDetails(int AdId) { HttpCookie UserIdCookie = Request.Cookies["_RRUID"]; HttpCookie KeyCookie = Request.Cookies["_RRPS"]; Utility en = new Utility(); if (UserIdCookie != null) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); Int32 Userid = Convert.ToInt32(en.Decrypt(UserIdCookie["_RRUID"])); List <Int32> UserAdList = new List <int>(); UserAdList = objservice.getAdIdsWithUserid(Userid); if (UserAdList.Contains(AdId)) { model = objservice.FetchAdDetails(AdId); ViewBag.AdId = model.AdID; //ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.SubCategoryName = model.txtSubCategoryName; ViewBag.Category = model.Category; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; return(View()); } else { return(RedirectToAction("UserAccount", "User")); } } else { return(RedirectToAction("Login", "User")); } }
public ActionResult AdDisplay(int AdId) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); model = objservice.SPRRGetAdDisplayDetails(AdId); ViewBag.IntAdId = model.AdID; ViewBag.AdId = model.AdID + ".jpg"; ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.Category = model.Category; ViewBag.SubCategoryName = model.txtSubCategoryName; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; ViewBag.Name = model.Name; ViewBag.MobileNumber = model.MobileNuber.ToString().Substring(0, 3) + "XXXXXX"; ViewBag.Location = model.Location; ViewBag.AdPostedDate = model.PostedDate.ToString(); if (model.Category == "Fruit" || model.Category == "Handloom" || model.Category == "Equipment" || model.Category == "Vegetable" || model.Category == "Others") { ViewBag.DefinedTitle = model.txtSubCategoryName + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } else { ViewBag.DefinedTitle = model.Category + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); } ViewBag.DefinedUnit = " /" + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); //searchingData //ViewBag.SearchOption = "CATEGORY"; //ViewBag.PageNumber = PageNumber; //ViewBag.CategoryID = CategoryID; return(View("AdDisplay")); }
public ActionResult AdDisplay(int AdId) { HttpCookie nameCookie = Request.Cookies["_RRAUN"]; if (nameCookie != null) { AdDetailsModel model = new AdDetailsModel(); InformationServiceWrapper objservice = new InformationServiceWrapper(); model = objservice.SPRRGetAdDisplayDetails(AdId); ViewBag.IntAdId = model.AdID; ViewBag.AdId = model.AdID + ".jpg"; ViewBag.Title = model.txtAddTitle; ViewBag.Description = model.txtAdDescription; ViewBag.Category = model.Category; ViewBag.Price = model.txtPrice; ViewBag.Quantity = model.txtQuantity; ViewBag.Unit = model.SellingUnit; ViewBag.Name = model.Name; ViewBag.MobileNumber = model.MobileNuber.ToString(); ViewBag.Location = model.Location; ViewBag.AdPostedDate = model.PostedDate; ViewBag.DefinedTitle = model.Category + " " + model.txtQuantity + " " + model.SellingUnit + " at Price Rs." + model.txtPrice + " Per " + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); ViewBag.DefinedUnit = " /" + model.SellingUnit.Substring(0, model.SellingUnit.Length - 1); //searchingData //ViewBag.SearchOption = "CATEGORY"; //ViewBag.PageNumber = PageNumber; //ViewBag.CategoryID = CategoryID; return(View("/Views/AddPost/AdDisplay.cshtml")); } else { return(RedirectToAction("Login", "Admin")); } }
public ActionResult FetchMandals(int DistrictId) { InformationServiceWrapper objservice = new InformationServiceWrapper(); return(Json(objservice.FetMandalsOfDistrct(DistrictId), JsonRequestBehavior.AllowGet)); }
public ActionResult FetchDistricts(int StateId) { InformationServiceWrapper objservice = new InformationServiceWrapper(); return(Json(objservice.FetDistrictsOfState(StateId), JsonRequestBehavior.AllowGet)); }
public ActionResult UserAccount() { HttpCookie KeyCookie = Request.Cookies["_RRPS"]; HttpCookie UserIdCookie = Request.Cookies["_RRUID"]; HttpCookie UserNameCookie = Request.Cookies["_RRUN"]; HttpCookie PhoneNumberCookie = Request.Cookies["_RRUPn"]; HttpCookie OTPCookie = Request.Cookies["_ROTP_"]; Utility en = new Utility(); if (PhoneNumberCookie != null && KeyCookie != null) { Int64 PhoneNumber = Convert.ToInt64(en.Decrypt(PhoneNumberCookie["_RRUPn"])); string PassWord = en.Decrypt(KeyCookie["_RRPS"]); UserDetailsModel DetObj = new UserDetailsModel(); InformationServiceWrapper Obj = new InformationServiceWrapper(); DetObj = Obj.GetUserDetailsWithPassword(PhoneNumber, PassWord); DropDownWrapperModel ModelObj = new DropDownWrapperModel(); ModelObj = Obj.GetDropDownValues(); ViewBag.DistrictLIst = ModelObj.District; ViewBag.MandalList = ModelObj.Mandal; if (DetObj != null) { ViewBag.txtUserName = DetObj.txtUserName; // ViewBag.txtMailId = DetObj.txtMailId; ViewBag.txtPhoneNumber = DetObj.txtPhoneNumber; ViewBag.txtVillage = DetObj.txtVillage; ViewBag.ddlState = DetObj.ddlState; ViewBag.ddlMandal = DetObj.ddlMandal; ViewBag.ddlDistrict = DetObj.ddlDistrict; } return(View("UserAccount")); } else if (PhoneNumberCookie != null && OTPCookie != null) { Int64 PhoneNumber = Convert.ToInt64(en.Decrypt(PhoneNumberCookie["_RRUPn"])); Utility UtilOBJ = new Utility(); int OTP = Convert.ToInt32(UtilOBJ.Decrypt(en.Decrypt(OTPCookie["_ROTP_"]))); UserDetailsModel DetObj = new UserDetailsModel(); InformationServiceWrapper Obj = new InformationServiceWrapper(); DetObj = Obj.GetUserDetailsWithOTP(OTP, PhoneNumber); DropDownWrapperModel ModelObj = new DropDownWrapperModel(); ModelObj = Obj.GetDropDownValues(); ViewBag.DistrictLIst = ModelObj.District; ViewBag.MandalList = ModelObj.Mandal; if (DetObj != null) { ViewBag.txtUserName = DetObj.txtUserName; //ViewBag.txtMailId = DetObj.txtMailId; ViewBag.txtPhoneNumber = DetObj.txtPhoneNumber; ViewBag.txtVillage = DetObj.txtVillage; ViewBag.ddlState = DetObj.ddlState; ViewBag.ddlMandal = DetObj.ddlMandal; ViewBag.ddlDistrict = DetObj.ddlDistrict; } return(View("UserAccount")); } else { return(RedirectToAction("Login", "User")); } }
public ActionResult Registration(FormCollection fnRegistration) { int count = 0; int UserId; //=(Int32)Session["_RRUID"]; UserDetailsModel objModel = new UserDetailsModel(); objModel.txtUserName = fnRegistration["txtUserName"]; objModel.txtPhoneNumber = Convert.ToInt64(fnRegistration["txtPhoneNumber"]); Utility en = new Utility(); objModel.txtPassword = en.Encrypt(fnRegistration["txtPassword"]); objModel.ddlState = fnRegistration["ddlStateText"]; objModel.ddlDistrict = fnRegistration["ddlDistrict"]; objModel.ddlMandal = fnRegistration["ddlMandal"]; objModel.txtVillage = fnRegistration["txtVillage"]; // objModel.txtMailId = fnRegistration["txtMailId"]; objModel.OTP = fnRegistration[""]; string s = "[^<>'\"/`%-]"; if (System.Text.RegularExpressions.Regex.IsMatch(objModel.txtUserName, s)) { count = count + 1; } if (System.Text.RegularExpressions.Regex.IsMatch(objModel.ddlState, "^[a-zA-Z0-9 .]{1,50}")) { count = count + 1; } if (System.Text.RegularExpressions.Regex.IsMatch(objModel.ddlDistrict, "^[a-zA-Z0-9 .]{1,50}")) { count = count + 1; } if (System.Text.RegularExpressions.Regex.IsMatch(objModel.ddlMandal, "^[a-zA-Z0-9 .]{1,50}")) { count = count + 1; } if (System.Text.RegularExpressions.Regex.IsMatch(en.Decrypt(objModel.txtPassword), s)) { count = count + 1; } if (System.Text.RegularExpressions.Regex.Match(objModel.txtPhoneNumber.ToString(), "[5-9]{1}[0-9]{9}").Success) { count = count + 1; } if (System.Text.RegularExpressions.Regex.IsMatch(objModel.txtVillage, s)) { count = count + 1; } GDictionaryModel GDOBJ = new GDictionaryModel(); if (count == 7) { ManagementServiceWrapper ObjService = new ManagementServiceWrapper(); InformationServiceWrapper infoObj = new InformationServiceWrapper(); GDOBJ = infoObj.MobileNumberVerification(objModel.txtPhoneNumber); if (GDOBJ.ID == 1) { UserId = ObjService.InsertAddUserDetails(objModel); if (UserId != 0) { HttpCookie KeyCookie = new HttpCookie("_RRPS"); KeyCookie.Values["_RRPS"] = en.Encrypt(objModel.txtPassword); KeyCookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(KeyCookie); } return(Json(UserId, JsonRequestBehavior.AllowGet)); } else { ViewBag.MobileError = "Entered Mobiler Number is already registered"; return(Json(GDOBJ.ID, JsonRequestBehavior.AllowGet)); } } else { GDOBJ.ID = -1; return(Json(GDOBJ.ID, JsonRequestBehavior.AllowGet)); } }