public string getNickName(int userID) { F_Profile_User fpu = new F_Profile_User(); Profile_User pu = new Profile_User(); pu.NickName = fpu.GetSingleByCondition(x => x.UserID == userID).NickName; return(pu.NickName); }
//Add / edit / delete public ActionResult AddPro() { Profile_User us = new Profile_User(); using (QLDaiHocEntities1 db = new QLDaiHocEntities1()) { us.IdCollection = db.User_Account.Where(a => a.Position == "trainer" | a.Position == "trainer").ToList(); } return(View(us)); }
public ActionResult EditPro(Profile_User pro) { QLDaiHocEntities1 db = new QLDaiHocEntities1(); Profile_User prous = new Profile_User(); prous.UserID = pro.UserID; prous.Full_Name = pro.Full_Name; prous.Address = pro.Address; prous.Phone = pro.Phone; prous.DateOfBirth = pro.DateOfBirth; db.Entry(prous).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("ProTrainer", "StaffPage")); }
public ActionResult AddPro(Profile_User pro) { using (QLDaiHocEntities1 db = new QLDaiHocEntities1()) { if (ModelState.IsValid) { db.Profile_User.Add(pro); db.SaveChanges(); return(RedirectToAction("ProTrainer", "StaffPage")); } else { return(RedirectToAction("ProTrainer", "StaffPage")); } } }