Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LogUserInfo logUserInfo = db.LogUserInfos.Find(id);

            db.LogUserInfos.Remove(logUserInfo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ID,EmpID,LastName,FirstName,PrefName,Position,Company,CostCenter,DeptName,Email,Manager,VP")] LogUserInfo logUserInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(logUserInfo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(logUserInfo));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "ID,EmpID,LastName,FirstName,PrefName,Position,Company,CostCenter,DeptName,Email,Manager,VP")] LogUserInfo logUserInfo)
        {
            if (ModelState.IsValid)
            {
                db.LogUserInfos.Add(logUserInfo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(logUserInfo));
        }
Beispiel #4
0
 private void GetUserName()
 {
     if (Session[Session_ID] != null)
     {
         LogUserInfo myUser = (LogUserInfo)Session[Session_ID];
         if (myUser != null)
         {
             LoginUserName = myUser.LoginUserName;
         }
     }
     lblLoginUserID.Text = LoginUserName;
 }
Beispiel #5
0
        // GET: LogUserInfoes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LogUserInfo logUserInfo = db.LogUserInfos.Find(id);

            if (logUserInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(logUserInfo));
        }
 private string GetLoginUserName()
 {
     if (HttpContext.Current.Session != null &&
         HttpContext.Current.Session[Session_ID] != null)
     {
         LogUserInfo myUser = (LogUserInfo)HttpContext.Current.Session[Session_ID];
         if (myUser != null)
         {
             return(myUser.LoginUserName.ToLower());
         }
         else
         {
             return("");
         }
     }
     else
     {
         return("");
     }
 }