public ActionResult ActiveUsers(List <UserProfileVM> lst) { for (int i = 0; i < lst.Count; i++) { if (lst[i].IsActive == true) { UserRegistration a = db.UserRegistrations.Find(lst[i].UserID); a.IsActive = false; db.Entry(a).State = System.Data.EntityState.Modified; db.SaveChanges(); } } // List<ActiveDeactiveUser> list1 = new List<ActiveDeactiveUser>(); // var data = db.UserRegistrations.Where(x => x.IsActive == true).ToList(); //foreach (var i in data) //{ // ActiveDeactiveUser a = new ActiveDeactiveUser(); // a.UserID = i.UserID; // a.FullName = i.FullName; // a.Email = i.Email; // a.Mobile = i.Mobile; // a.City = i.City; // a.IsActive = false; // list1.Add(a); //} return(RedirectToAction("ActiveUsers")); }
public ActionResult PaymentCompleted(string key) { string iuserid = Base64Decode(key); iuserid = iuserid.Replace("cryptho", ""); UserRegistration a = db.UserRegistrations.Find(key); a.IsActive = true; db.Entry(a).State = System.Data.EntityState.Modified; db.SaveChanges(); return(View()); }
public ActionResult EditProfile(UserProfileVM obj) { try { UserRegistration u = db.UserRegistrations.Find(obj.UserID); if (u != null) { u.FirstName = obj.FirstName; u.MiddleName = obj.MiddleName; u.LastName = obj.LastName; u.Email = obj.Email; } UserProfile o = db.UserProfiles.Find(obj.UserID); o.MritalStatus = obj.MaritalStatusID; o.DateOfBirth = Convert.ToDateTime(obj.BirthDateDisplay); //obj.DateOfBirth; o.BirthName = obj.BirthName; o.BirthPlace = obj.BirthPlace; o.BirthTime = obj.BirthTime; o.Gotra = obj.Gotra; o.SubCasteID = obj.SubCasteID; o.ComplexionID = obj.ComplexionID; o.HeightID = obj.HeightID; o.WeightID = obj.WeightID; o.PhysicallyChalengeID = obj.PhysicalChalengeID; o.BloodGroupID = obj.BloodGroupID; o.SpectacleID = obj.SpectacleID; o.RAddress = obj.RAddress; o.MulGaon = obj.MulGaon; o.StateID = obj.StateID; o.DistrictID = obj.CityID; o.TalukaID = obj.TalukaID; o.DegreeID = obj.SchoolID; o.EducationDetail = obj.EducationDetail; o.CareerID = obj.ServiceBusinessID; o.ServiceDetail = obj.ServiceDetail; o.SalaryAnual = obj.SalaryAnual; o.FatherName = obj.FatherName; o.MotherName = obj.MotherName; o.FatherOccupation = obj.FatherOccupation; o.ContactNo = obj.FatherContactNo; o.MamaName = obj.MamaSurName; o.MamaPlace = obj.MamaPlace; HttpPostedFileBase b = Request.Files["ImageFile"] as HttpPostedFileBase; if (b != null) { string pic = System.IO.Path.GetFileName(b.FileName); if (pic != "") { string path = Path.Combine(Server.MapPath("~/Images"), Session["UserID"].ToString() + ".jpg"); string ipath = "/Images/" + Session["UserID"].ToString() + ".jpg"; b.SaveAs(path); int uid = Convert.ToInt32(Session["UserID"].ToString()); o.ImagePath = ipath; } } db.Entry(o).State = System.Data.EntityState.Modified; db.SaveChanges(); db.Entry(u).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch (Exception) { } return(RedirectToAction("ViewProfile")); }