예제 #1
0
        public ActionResult DeleteConfirmed(byte id)
        {
            tbService tbService = db.tbService.Find(id);

            db.tbService.Remove(tbService);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "ServID,ServiveName,Prefix,CCopy,ExpWait,Announce,StartQ,EndQ,LastQ,QDate,Remark,Remark1,Speaker,OverTime,ProCS1,ProCS2,ProCS3,ProCS4,QLimit,QLimitTime,ProCS5,DeptID,ServiceFullName")] tbService tbService)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbService).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbService));
 }
예제 #3
0
        // GET: tbServices/Delete/5
        public ActionResult Delete(byte?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbService tbService = db.tbService.Find(id);

            if (tbService == null)
            {
                return(HttpNotFound());
            }
            Models.Configdepartment.tbDepartMent dpt = dp.tbDepartMent.Find(tbService.DeptID);
            ViewBag.Depart = dpt.DeptName.ToString();
            return(View(tbService));
        }
예제 #4
0
        // GET: tbServices/Edit/5
        public ActionResult Edit(byte?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbService tbService = db.tbService.Find(id);

            if (tbService == null)
            {
                return(HttpNotFound());
            }
            IEnumerable <SelectListItem> items2 = dp.tbDepartMent
                                                  .Select(d => new SelectListItem
            {
                Value = d.DeptID.ToString(),
                Text  = d.DeptID.ToString() + "." + d.DeptName
            });

            ViewBag.DM          = items2;
            ViewBag.servicename = tbService.ServiceFullName.ToString();
            return(View(tbService));
        }