public ActionResult AddLostPeople() { clsFoundedPeople objLostppl = new clsFoundedPeople(); return(View(objLostppl)); // return View(); }
//public List<clsRole> GetRoles() //{ // using (var maincontext = new Entity.ShoppingEntities()) // { // var objgetRoles = maincontext.Web_Roles().ToList(); // List<clsRole> lstRoles = new List<clsRole>(); // if (objgetRoles.Count() > 0) // { // foreach (var Roles in objgetRoles) // { // clsRole objRolesDetails = new clsRole(); // objRolesDetails.RoleId = Roles.id; // objRolesDetails.Role = Roles.Role; // lstRoles.Add(objRolesDetails); // } // return lstRoles; // } // return lstRoles; // } //} public int ApproveRefuse(clsFoundedPeople objFoundedPeople) { using (var maincontext = new Entity.LostAndFindEntities()) { var obj = new Entity.tblUplodedFindPeople(); //var obj = maincontext.tblPractices.FirstOrDefault(); if (obj != null) { if (objFoundedPeople.Id > 0) { var id = objFoundedPeople.Id; var objspeci = new Entity.tblUplodedFindPeople(); objspeci = maincontext.tblUplodedFindPeoples.Single(a => a.id == id); objspeci.IsApproved = objFoundedPeople.IsApproved; maincontext.SaveChanges(); return(1); } else { return(1); } } else { return(0); } } }
public ActionResult ApproveRefuse(clsFoundedPeople objFoundedPeople) { if (Session["UserInfo"] != null) { var UserRole = ((Shopping.Model.clsSignin)Session["UserInfo"]).Role; if (UserRole == "Admin") { var ApproveRefuse_Result = (new AdminBLL()).ApproveRefuse(objFoundedPeople); if (ApproveRefuse_Result == 1) { return(Json(new { Status = "Success", Message = "image has been Approve/Refuse successfully." })); } else if (ApproveRefuse_Result == 2) { return(Json(new { Status = "Success", Message = "image has been Approve/Refuse successfully." })); } else if (ApproveRefuse_Result == 0) { return(Json(new { Status = "Failure", Message = "There is already a specility with this name, Try with a different name. " })); } else { return(Json(new { Status = "Failure", Message = "Seems something is wrong! Please try again later." })); } } } return(RedirectToAction("Logout")); }
public ActionResult SaveFoundPeolpeDetail(clsFoundedPeople objfoundedppl) { if (objfoundedppl.Latitude != null && objfoundedppl.Longitude != null) { //{ // RootObject rootObject = getAddress(23.5270797, 77.2548046); // Console.WriteLine("Full Address " + rootObject.display_name); //} string address = calcularRota(Convert.ToString(objfoundedppl.Latitude), Convert.ToString(objfoundedppl.Longitude)); if (!string.IsNullOrEmpty(address) && !address.Contains("DENIED")) { char[] commaSeparator = new char[] { ',' }; char[] spacrSeparator = new char[] { ' ' }; string[] addressArray = address.Split(commaSeparator, StringSplitOptions.None); var length = addressArray.Length; string[] statepincode = addressArray[length - 2].Split(spacrSeparator, StringSplitOptions.None); var length1 = statepincode.Length; string State = statepincode[length1 - 2]; string PinCode = statepincode[length1 - 1]; string City = addressArray[length - 3]; string Country = addressArray[length - 1]; string FullAddress = address; string Address = address.Split(',').Take(length - 3).Aggregate((s1, s2) => s1 + "," + s2).Substring(0); objfoundedppl.Address = Address; objfoundedppl.City = City; objfoundedppl.State = State; objfoundedppl.Country = Country; objfoundedppl.Pincode = PinCode; objfoundedppl.FullAddress = FullAddress; } else { //RootObject rootObject = getAddress(23.5270797, 77.2548046); //Console.WriteLine("Full Address " + rootObject.display_name); } } var Savruser_Result = (new HomeBLL()).SaveFoundPeolpeDetail(objfoundedppl); if (Savruser_Result != null) { if (Savruser_Result == 1) { return(Json(new { Status = "Success", Message = "Congrats! User details saved successfully" })); } else if (Savruser_Result == 2) { return(Json(new { Status = "Success", Message = "Congrats! User details saved successfully" })); } else { return(Json(new { Status = "Failure", Message = "Username you have entered is already in use for another account. Tryout with different username." })); } } return(Json(new { Status = "Failure", Message = "Oops! Something went wrong while processing your request. Please try again later." })); return(View()); }
public int SaveFoundPeolpeDetail(clsFoundedPeople objfoundedppl) { using (var maincontext = new Entity.LostAndFindEntities()) { var db_Result = maincontext.Web_SaveFindpeopleDetail(0, objfoundedppl.FirstName, objfoundedppl.LastName, objfoundedppl.FindPeopleImage, objfoundedppl.Latitude, objfoundedppl.Longitude, objfoundedppl.EmailId, objfoundedppl.Phone, objfoundedppl.IsActive, objfoundedppl.IsApproved, objfoundedppl.UserId.ToString(), objfoundedppl.Address, objfoundedppl.FullAddress, objfoundedppl.City, objfoundedppl.State, objfoundedppl.Country, objfoundedppl.Pincode, objfoundedppl.LostOrFound).FirstOrDefault(); return(1); //return db_Result.UserResult; } }
public List <clsFoundedPeople> GetFoundedPeople(int Id) { using (var maincontext = new Entity.LostAndFindEntities()) { List <clsFoundedPeople> lstFoundedPeople = new List <clsFoundedPeople>(); var objgetFindpeopleDetail = maincontext.Web_GetFindpeopleDetail(Id).ToList(); if (objgetFindpeopleDetail.Count() > 0) { foreach (var FindpeopleDetail in objgetFindpeopleDetail) { clsFoundedPeople objpeopleDetail = new clsFoundedPeople(); objpeopleDetail.FirstName = FindpeopleDetail.FirstName; objpeopleDetail.LastName = FindpeopleDetail.LastName; objpeopleDetail.EmailId = FindpeopleDetail.EmailId; objpeopleDetail.FindPeopleImage = FindpeopleDetail.FindPeopleImage; objpeopleDetail.Phone = FindpeopleDetail.Phone; objpeopleDetail.Latitude = FindpeopleDetail.Latitude; objpeopleDetail.Longitude = FindpeopleDetail.Longitude; objpeopleDetail.IsActive = FindpeopleDetail.IsActive; objpeopleDetail.IsApproved = FindpeopleDetail.IsApproved; objpeopleDetail.Address = FindpeopleDetail.Address; objpeopleDetail.Id = FindpeopleDetail.id; objpeopleDetail.FullAddress = FindpeopleDetail.FullAddress; objpeopleDetail.City = FindpeopleDetail.City; objpeopleDetail.State = FindpeopleDetail.State; objpeopleDetail.Country = FindpeopleDetail.Country; objpeopleDetail.Pincode = FindpeopleDetail.PinCode; objpeopleDetail.LostOrFound = FindpeopleDetail.LostOrFound; lstFoundedPeople.Add(objpeopleDetail); } return(lstFoundedPeople); } return(lstFoundedPeople); } }
public ActionResult Event(clsFoundedPeople objfoundppl) { string address = calcularRota(Convert.ToString(objfoundppl.Latitude), Convert.ToString(objfoundppl.Longitude)); char[] commaSeparator = new char[] { ',' }; string[] authors = address.Split(commaSeparator, StringSplitOptions.None); //string Country = authors[5]; //string State = authors[4]; //string City = authors[3]; //string fullAddress = address; var offset = address.IndexOf(','); offset = address.IndexOf(':', offset + 1); var result = address.IndexOf(':', offset + 1); foreach (string author in authors) { Console.WriteLine(author); } return(View()); }
public int SaveFoundPeolpeDetail(clsFoundedPeople objfoundedppl) { return((new HomeDAL()).SaveFoundPeolpeDetail(objfoundedppl)); }
//public List<clsRole> GetRoles() //{ // List<clsRole> lstRoles = new List<clsRole>(); // return lstRoles = (new AdminDAL()).GetRoles(); //} public int ApproveRefuse(clsFoundedPeople objFoundedPeople) { return((new AdminDAL()).ApproveRefuse(objFoundedPeople)); }