public ContentResult SaveVar(string jsonString) { AjaxResult res = new AjaxResult(); try { WF_TemplateVariable role = jsonString.ToObject <WF_TemplateVariable>(); WF_TemplateVariable entity = varbll.getByID(role.ID); if (entity != null) { role.UpdateTime = DateTime.Now; role.UpdateUserCode = getCurrent().UserCode; role.CreateTime = entity.CreateTime; role.CreateUserCode = entity.CreateUserCode; role.IsDelete = entity.IsDelete; varbll.update(role); } else { role.UpdateTime = DateTime.Now; role.UpdateUserCode = getCurrent().UserCode; role.CreateTime = DateTime.Now; role.CreateUserCode = getCurrent().UserCode; role.IsDelete = 0; varbll.save(role); } res.code = ResultCode.OK; } catch (Exception ex) { res.code = ResultCode.ERROR; res.message = "保存失败"; } return(Content(res.ToJson())); }
public bool update(WF_TemplateVariable entity) { using (IDbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["wfdb"].ToString())) { conn.Open(); return(conn.Update <WF_TemplateVariable>(entity)); } }
public bool save(WF_TemplateVariable entity) { using (IDbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["wfdb"].ToString())) { conn.Open(); conn.Insert <WF_TemplateVariable>(entity); return(true); } }
public bool del(int id) { using (IDbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["wfdb"].ToString())) { conn.Open(); WF_TemplateVariable Role_User = conn.Get <WF_TemplateVariable>(id); Role_User.IsDelete = 1; return(conn.Update <WF_TemplateVariable>(Role_User)); } }
public ContentResult UpdateVarState(int id, int state) { AjaxResult res = new AjaxResult(); try { WF_TemplateVariable entity = varbll.getByID(id); if (entity != null) { entity.State = state; varbll.update(entity); } res.code = ResultCode.OK; res.message = "更新状态成功"; } catch (Exception ex) { res.code = ResultCode.ERROR; res.message = "更新状态失败"; } return(Content(res.ToJson())); }
public ContentResult getVarByID(int id) { AjaxResult res = new AjaxResult(); try { WF_TemplateVariable role = varbll.getByID(id); if (role == null) { role = new WF_TemplateVariable(); role.ID = id; role.State = 1; } res.code = ResultCode.OK; res.data = role; } catch (Exception ex) { res.code = ResultCode.ERROR; res.message = "获取流程角色信息失败"; } return(Content(res.ToJson())); }
public bool update(WF_TemplateVariable entity) { return(dao.update(entity)); }
public bool save(WF_TemplateVariable entity) { return(dao.save(entity)); }