Example #1
0
        public ActionResult saveTXInfoData(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_PK_TXModel model = new T_BASE_COMPANY_PK_TXModel();
                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_PK_TXModel model = new T_BASE_COMPANY_PK_TXModel();
                this.GetModelValue(model, data);
                model.CLCS       = data.Get("CLCSS");
                model.CSLX       = data.Get("CSLXS");
                model.UPDATETIME = DateTime.Now;
                model.UPDATEUSER = CurrentUser.UserName;
                result           = model.Update(T_BASE_COMPANY_PK_TX.ID == data.Get("rowID").Trim());
            }
            if (result)
            {
                msg = new { success = true, data = "保存成功" };
            }
            return(Json(msg));
        }
Example #2
0
        public ActionResult DelTXInfoInfoByID(RequestData data)
        {
            string rowID = string.Empty;
            var    msg   = new { success = false, data = "删除失败" };
            T_BASE_COMPANY_PK_TXModel model = new T_BASE_COMPANY_PK_TXModel();

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

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