Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CaseServiceType caseservicetype = db.CaseServiceTypes.Find(id);

            db.CaseServiceTypes.Remove(caseservicetype);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        //
        // GET: /Admin/CaseServiceType/Edit/5

        public ActionResult Edit(int id = 0)
        {
            CaseServiceType caseservicetype = db.CaseServiceTypes.Find(id);

            if (caseservicetype == null)
            {
                return(HttpNotFound());
            }
            return(View(caseservicetype));
        }
Exemple #3
0
 public ActionResult Edit(CaseServiceType caseservicetype)
 {
     if (ModelState.IsValid)
     {
         //db.Entry(caseservicetype).State = EntityState.Modified;
         caseservicetype.Update();
         return(RedirectToAction("Index"));
     }
     return(View(caseservicetype));
 }
Exemple #4
0
        public ActionResult Create(CaseServiceType caseservicetype)
        {
            if (ModelState.IsValid)
            {
                db.CaseServiceTypes.Add(caseservicetype);
                caseservicetype.Create(db, db.CaseServiceTypes);
                return(RedirectToAction("Index"));
            }

            return(View(caseservicetype));
        }
Exemple #5
0
        public ActionResult Sort(string sortData)
        {
            if (!string.IsNullOrEmpty(sortData))
            {
                string[] tempDatas = sortData.TrimEnd(',').Split(',');
                foreach (string tempData in tempDatas)
                {
                    string[]        itemDatas       = tempData.Split(':');
                    CaseServiceType caseservicetype = db.CaseServiceTypes.Find(Convert.ToInt16(itemDatas[0]));
                    caseservicetype.ListNum = Convert.ToInt16(itemDatas[1]);

                    //db.Entry(publish).State = EntityState.Modified;
                    db.SaveChanges();
                }
            }
            return(RedirectToAction("Index"));
        }