示例#1
0
        public ActionResult Editor(hx_AdminLimitInfo t)
        {
            t = (hx_AdminLimitInfo)Common.Utils.ValidateModelClass(t);
            t.ControllerName = Utils.CheckSQL(DNTRequest.GetString("ConName"));
            t.ActionName     = Utils.CheckSQL(DNTRequest.GetString("ActName"));
            string[] proNames;

            proNames   = new string[] { "title", "ControllerName", "ActionName", "SortId", "lastOper", "lastTime" };
            t.lastOper = Utils.GetAdmUserID().ToString();
            t.lastTime = DateTime.Now;
            DbEntityEntry entry = ef.Entry <hx_AdminLimitInfo>(t);

            entry.State = EntityState.Unchanged;

            foreach (string ProName in proNames)
            {
                entry.Property(ProName).IsModified = true;
            }
            int result = ef.SaveChanges();

            if (result > 0)
            {
                return(Content(StringAlert.Alert("操作成功", "/admin/Limit/Index"), "text/html"));
            }
            else
            {
                return(Content(StringAlert.Alert("操作失败"), "text/html"));
            }
        }
示例#2
0
        public ActionResult Add(hx_AdminLimitInfo t)
        {
            t           = (hx_AdminLimitInfo)Common.Utils.ValidateModelClass(t);
            t.isDel     = 0;
            t.lastOper  = Utils.GetAdmUserID().ToString();
            t.lastTime  = DateTime.Now;
            t.CreatTime = DateTime.Now;
            ef.hx_AdminLimitInfo.Add(t);
            int id = ef.SaveChanges();

            if (id > 0)
            {
                //return Content(StringAlert.Alert("操作成功"), "text/html");
                return(Content(StringAlert.Alert("操作成功", "/admin/Limit/Index"), "text/html"));
            }
            else
            {
                return(Content(StringAlert.Alert("操作失败"), "text/html"));
            }
        }