public ActionResult savePKInfoData(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_PKModel model = new T_BASE_COMPANY_PKModel(); 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_PKModel model = new T_BASE_COMPANY_PKModel(); this.GetModelValue(model, data); model.UPDATETIME = DateTime.Now; model.UPDATEUSER = CurrentUser.UserName; result = model.Update(T_BASE_COMPANY_PK.ID == data.Get("rowID").Trim()); } if (result) { msg = new { success = true, data = "保存成功" }; } return(Json(msg)); }
public ActionResult DelPKInfoInfoByID(RequestData data) { string rowID = string.Empty; var msg = new { success = false, data = "删除失败" }; T_BASE_COMPANY_PKModel model = new T_BASE_COMPANY_PKModel(); model.ISDEL = "1"; model.UPDATETIME = DateTime.Now; model.UPDATEUSER = CurrentUser.UserName; bool result = model.Update(T_BASE_COMPANY_PK.ID == data.Get("id")); if (result) { msg = new { success = true, data = "删除成功" }; } return(Json(msg)); }