public void AddAccount(PhanNhomNVViewModel model) { var newemp = new TBL_LOGIN { USERNAME = model.TenNV, PHONE = model.SDT, EMAIL = model.Email, PASSWORD = model.PassWord, ISADMIN = false, ACTIVATE = true, CREATED_DATE = DateTime.Now, CREATED_BY = HttpContext.Current.User.Identity.Name }; context.TBL_LOGINs.Add(newemp); context.SaveChanges(); }
public bool Add(PhanNhomNVViewModel model) { var nv = new TBL_LOGIN { USERNAME = model.TenNV, PASSWORD = model.PassWord, EMAIL = model.Email, PHONE = model.SDT, ACTIVATE = true, ISADMIN = false, CREATED_DATE = DateTime.Now, CREATED_BY = HttpContext.Current.User.Identity.Name, }; context.TBL_LOGINs.Add(nv); context.SaveChanges(); return(true); }
public ActionResult Create(PhanNhomNVViewModel collection) { try { // TODO: Add insert logic here if (ModelState.IsValid) { nv.Add(collection); return(RedirectToAction("Index", "PhanNhomNV")); } return(View(collection)); } catch { return(View()); } }