Ejemplo n.º 1
0
        public ActionResult saveZLDeviceData(RequestData data)
        {
            var  msg    = new { success = false, data = "保存失败" };
            bool result = false;

            if (!string.IsNullOrEmpty(data.Get("SHOWTYPE")) && data.Get("SHOWTYPE").Trim() == "0") //新增
            {
                T_BASE_COMPANY_ZLModel model = new T_BASE_COMPANY_ZLModel();
                this.GetModelValue(model, data);
                model.CREATEUSER = CurrentUser.UserName;
                result           = model.Insert();
            }
            else if (!string.IsNullOrEmpty(data.Get("SHOWTYPE")) && data.Get("SHOWTYPE").Trim() == "1") //编辑
            {
                T_BASE_COMPANY_ZLModel model = new T_BASE_COMPANY_ZLModel();
                this.GetModelValue(model, data);
                model.UPDATETIME = DateTime.Now;
                model.UPDATEUSER = CurrentUser.UserName;
                result           = model.Update(T_BASE_COMPANY_ZL.ID == data.Get("rowID").Trim());
            }
            if (result)
            {
                msg = new { success = true, data = "保存成功" };
            }
            return(Json(msg));
        }
Ejemplo n.º 2
0
        public ActionResult DelZLDeviceInfoByID(RequestData data)
        {
            string rowID = string.Empty;
            var    msg   = new { success = false, data = "删除失败" };
            T_BASE_COMPANY_ZLModel model = new T_BASE_COMPANY_ZLModel();

            model.ISDEL      = "1";
            model.UPDATETIME = DateTime.Now;
            model.UPDATEUSER = CurrentUser.UserName;
            bool result = model.Update(T_BASE_COMPANY_ZL.ID == data.Get("id"));

            if (result)
            {
                msg = new { success = true, data = "删除成功" };
            }
            return(Json(msg));
        }