Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(string id)
        {
            SYS_DATADICLIST hr_sys_datadiclist = DbContext.SYS_DATADICLIST.Find(id);

            DbContext.SYS_DATADICLIST.Remove(hr_sys_datadiclist);
            DbContext.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public ActionResult Details(string id = null)
        {
            SYS_DATADICLIST hr_sys_datadiclist = DbContext.SYS_DATADICLIST.Find(id);

            if (hr_sys_datadiclist == null)
            {
                return(HttpNotFound());
            }
            return(View(hr_sys_datadiclist));
        }
Ejemplo n.º 3
0
        public JsonResult Create(FormCollection collection)
        {
            try
            {
                SYS_DATADICLIST model = new SYS_DATADICLIST();
                model.GUID       = Guid.NewGuid();
                model.UNIQUEFLAG = collection["UniqueFlag"].ToString();
                model.DATANAME   = collection["DataName"].ToString();
                model.PARENTCODE = "0";
                model.SEQUENCE   = 0;
                model.ISTREE     = "0";
                DbContext.SYS_DATADICLIST.Add(model);
                DbContext.SaveChanges();

                return(new JsonM().ToJson(true, MsgHelper.SaveSuccess));
            }
            catch (Exception ex)
            {
                return(new JsonM().ToJson(false, MsgHelper.SaveFail, ex.Message));
            }
        }
Ejemplo n.º 4
0
        public ActionResult Delete(string UniqueFlag = "")
        {
            try
            {
                SYS_DATADICLIST model =
                    DbContext.SYS_DATADICLIST
                    .First(m => m.UNIQUEFLAG == UniqueFlag);
                if (model == null)
                {
                    return(new JsonM().ToJson(true, "记录已删除!"));
                }
                else
                {
                    DbContext.SYS_DATADICLIST.Remove(model);

                    DbContext.SaveChanges();
                    return(new JsonM().ToJson(true, MsgHelper.DeleteSuccess));
                }
            }
            catch (Exception ex)
            {
                return(new JsonM().ToJson(false, MsgHelper.DeleteFail, ex.Message));
            }
        }