public ActionResult Corpus(User ur) { ur._Donation._CorpusFund = new CorpusFund(); ur._Donation.PaymentDate = DateTime.Now; Session["UserData"] = ur; return RedirectToAction("../Payment/Pay"); }
public ActionResult Create(User ur) { ur.ProgrammId = i; ur._Donation.ProgrammId = i; ur._Donation.PaymentDate = DateTime.Now; Session["UserData"] = ur; return RedirectToAction("../Payment/Pay"); }
public ActionResult Create(User ur) { ur.ProgrammId = i; // ur.DonationId = i; //ur.Donations.DonationId = i; ur._Donation.PaymentDate = DateTime.Now; um.AddUser(ur); ViewBag.Message = "Payment is Successful"; return View(); }
/// <summary> /// palak /// check for registrations /// </summary> /// <param name="u"></param> /// <returns></returns> public ActionResult Create(User u) { var list = um.GetAll(); if (list.Contains(list.FirstOrDefault(q => q.MailId == u.MailId && q.FirstName == null))) { ViewBag. ErrorMessage = "You are already registered"; return View(); } Role r1 = new Role(); r1.RoleId = 13; r1.RoleName = "User"; Role r2 = new Role(); r2.RoleId = 14; r2.RoleName = "Admin"; List<Role> option = new List<Role>(); option.Add(r1); option.Add(r2); ViewBag.Role = new SelectList(option, "RoleId", " RoleName"); u.RegistrationDate = DateTime.Now; um.saveUser(u); //mail method int id = um.GetAll().Max(a => a.UserId); Email mail = new Email(); mail.FromAddress = "*****@*****.**"; mail.ToAddress = u.MailId; mail.Subject = "Thank you for registration"; mail.Body = "Hi" + u.MailId + "Thank you for registering at Right to Live./nYour account will be validated once you log in by clicking on this link or copying and pasting it in your browser:/http://localhost:31780/User/Edit/" + Convert.ToString(id) + "This is a one-time login, so it can be used only once./n/nHave a great day,/nRight to Live Team"; if (es.SendMail(mail)) { //ViewBag.Message = "Registration Success,a link is sent to your Email Id"; return View("RegistrationSuccess"); } else { ViewBag.ErrorMessage = "Sorry,We are unable to connect to the Network"; return View(); } }
public ActionResult Create(User user, string ProgrammTitle) { int prgId = int.Parse(ProgrammTitle); // TODO: Add insert logic here List<Programm > prgs = pManager.GetProgram(); SelectList prg1 = new SelectList(prgs, "ProgrammId", "ProgrammTitle"); ViewBag.programList = prg1; Programm prg = null; prg = prgs.FirstOrDefault(p => p.ProgrammId == prgId); if (ProgrammTitle == null) { user._Donation._CorpusFund = new CorpusFund(); } else { user.ProgrammId = prg.ProgrammId; user._Donation.ProgrammId = prg.ProgrammId; } //user.RegistrationDate = DateTime.Now; dManager.Add(user); return RedirectToAction("DonorSuccess"); }
public void SaveChanges(User u) { repo.Update(u); }
public ActionResult Login(User u) { var slist = um.GetAll(); if (slist.Contains(slist.FirstOrDefault(q => q.MailId == u.MailId && q.Password == u.Password))) { ViewBag.Success = "LogIn sucessfully"; return RedirectToAction("../Home/Index"); } ViewBag.Success = "please check your mailid or password"; ModelState.AddModelError("Password"," for recovering password please click Above link "); return View("Login1"); }
public ActionResult ForgotPassword( User u) { var list = um.GetAll(); if (list.Contains(list.FirstOrDefault(q => q.MailId == u.MailId))) { string password = list.FirstOrDefault(u1 => u1.MailId == u.MailId&& u1.Password!=null).Password; Email mail = new Email(); mail.FromAddress = "*****@*****.**"; mail.ToAddress = u.MailId; mail.Subject = "Password Link "; mail.Body = password; if (es.SendMail(mail)) { //ViewBag.Message = "Link is sent to mail id"; return View("ConfirmationMail"); } else { ViewBag.ErrorMessage = "Sorry,We are unable to connect to the Network"; return View(); } } else { ViewBag.Message = "Sorry,You Are not Registred"; return View(); } }
public ActionResult Editaccount(User u, HttpPostedFileBase name) { Picture pic = new Picture(); List<Picture> pc = new List<Picture>(); byte[] array; if (name != null) { using (MemoryStream ms = new MemoryStream()) { name.InputStream.CopyTo(ms); array = ms.GetBuffer(); pic.Pictures = array; u.UserPicture.Pictures = array; pm.savePicture(pic); } } int id=pm.GetAll().Max(p=>p.PictureId); u.UserPicture.PictureId = id; // u.PictureId = id; um.EditUser(u); return View("View1"); }
public ActionResult Edit(User u, int CityID, int StateID, int CountryID) { List<Country> countries = locmng.GetAllCountries(); ViewBag.countrylist = new SelectList(countries.OrderBy(c => c.Name), "CountryID", "Name"); List<City> citylist = locmng.GetAllCities(); ViewBag.cities = new SelectList(citylist, "CityID", "Name"); um.UpdateUser(u, CityID); return View("View1"); }
public ActionResult Edit(int id, User user) { try { // TODO: Add update logic here dManager.SaveChanges(user); return RedirectToAction("../ChangeProgram/Index"); } catch { return RedirectToAction("EditDonorSuccess"); } }