public ActionResult Edit([Bind(Include = "ID,Name,LastName,Email,ImageUrl,Telephone,Password,TCKN,IsActive,IsAdmin,CreateDateTime,CreateUserID,UpdateDateTime,UpdateUserID")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         _logClass.UserLog(user, "Düzenleme", LoginUserId);
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Пример #2
0
        public ActionResult Create([Bind(Include = "ID,Name,LastName,Email,ImageUrl,Telephone,Password,TCKN,IsActive,IsAdmin,CreateDateTime,CreateUserID,UpdateDateTime,UpdateUserID")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                User sessions = Session["AdminLoginUser"] as User;
                if (sessions != null)
                {
                    _logClass.UserLog(user, "Ekleme", sessions.Id);
                }
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }