Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblplannedbreak tblplannedbreak = db.tblplannedbreaks.Find(id);

            db.tblplannedbreaks.Remove(tblplannedbreak);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        //
        // GET: /PlannedBreak/Details/5

        public ActionResult Details(int id = 0)
        {
            tblplannedbreak tblplannedbreak = db.tblplannedbreaks.Find(id);

            if (tblplannedbreak == null)
            {
                return(HttpNotFound());
            }
            return(View(tblplannedbreak));
        }
        public JsonResult DeleteData(int id = 0)
        {
            tblplannedbreak tblplannedbreak = db.tblplannedbreaks.Find(id);

            tblplannedbreak.IsDeleted       = 1;
            tblplannedbreak.ModifiedBy      = 1;
            tblplannedbreak.ModifiedOn      = DateTime.Now;
            db.Entry(tblplannedbreak).State = EntityState.Modified;
            db.SaveChanges();
            return(Json(tblplannedbreak.BreakID, JsonRequestBehavior.AllowGet));
        }
 public ActionResult Edit(tblplannedbreak tblplannedbreak)
 {
     if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
     {
         return(RedirectToAction("Login", "Login", null));
     }
     ViewBag.Logout                  = Session["Username"].ToString().ToUpper();
     ViewBag.roleid                  = Session["RoleID"];
     tblplannedbreak.ModifiedBy      = 1;
     tblplannedbreak.ModifiedOn      = DateTime.Now;
     tblplannedbreak.IsDeleted       = 0;
     db.Entry(tblplannedbreak).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
        public ActionResult Edit(int id = 0)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            tblplannedbreak tblplannedbreak = db.tblplannedbreaks.Find(id);

            if (tblplannedbreak == null)
            {
                return(HttpNotFound());
            }
            return(View(tblplannedbreak));
        }
        public JsonResult InsertData(string st, string br, string et)
        {
            tblplannedbreak tblplannedbreak = new tblplannedbreak();

            tblplannedbreak.CreatedBy   = 1;
            tblplannedbreak.CreatedOn   = DateTime.Now;
            tblplannedbreak.IsDeleted   = 0;
            tblplannedbreak.StartTime   = Convert.ToDateTime(st).TimeOfDay;
            tblplannedbreak.EndTime     = Convert.ToDateTime(et).TimeOfDay;
            tblplannedbreak.BreakReason = br;
            {
                db.tblplannedbreaks.Add(tblplannedbreak);
                db.SaveChanges();
            }
            return(Json(tblplannedbreak.BreakID, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Delete(int id = 0)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout = Session["Username"].ToString().ToUpper();
            ViewBag.roleid = Session["RoleID"];
            tblplannedbreak tblplannedbreak = db.tblplannedbreaks.Find(id);

            if (tblplannedbreak == null)
            {
                return(HttpNotFound());
            }
            tblplannedbreak.IsDeleted       = 1;
            tblplannedbreak.ModifiedBy      = 1;
            tblplannedbreak.ModifiedOn      = System.DateTime.Now;
            db.Entry(tblplannedbreak).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 8
0
        public ActionResult Create(tblplannedbreak tblplannedbreak)
        {
            if ((Session["UserId"] == null) || (Session["UserId"].ToString() == String.Empty))
            {
                return(RedirectToAction("Login", "Login", null));
            }
            ViewBag.Logout            = Session["Username"];
            ViewBag.roleid            = Session["RoleID"];
            tblplannedbreak.CreatedBy = 1;
            tblplannedbreak.CreatedOn = DateTime.Now;
            tblplannedbreak.IsDeleted = 0;

            //if (ModelState.IsValid)
            {
                db.tblplannedbreaks.Add(tblplannedbreak);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblplannedbreak));
        }