/// <summary> /// 保存关系Auth_Rlt_RoleAuthorization /// </summary> public ActionResult SaveRelation_RoleAuthorization(string AuthorizationID, List <string> RoleIDS) { foreach (var item in RoleIDS) { var entity = NH.GetSession <Auth_Authorization>().QueryOver <Auth_Rlt_RoleAuthorization>().Where(x => x.RoleID == item && x.AuthorizationID == AuthorizationID).List().FirstOrDefault(); if (entity == null) { entity = new Auth_Rlt_RoleAuthorization() { AuthorizationID = AuthorizationID, RoleID = item }; entity.Save(); } } return(Json(new { success = true })); }
/// <summary> /// 保存关系WF_NodePage /// </summary> public ActionResult SaveRelation_NodePage(int NodeID, List <string> PageIDS) { foreach (var item in PageIDS) { var entity = NH.GetSession <WF_Node>().QueryOver <WF_NodePage>().Where(x => x.PageID == item && x.NodeID == NodeID).List().FirstOrDefault(); if (entity == null) { entity = new WF_NodePage() { NodeID = NodeID, PageID = item }; entity.Save(); } } return(Json(new { success = true })); }
/// <summary> /// 保存关系WF_NodeEmp /// </summary> public ActionResult SaveRelation_NodeEmp(int FK_Node, List <string> FK_EmpS) { foreach (var item in FK_EmpS) { var entity = NH.GetSession <WF_Node>().QueryOver <WF_NodeEmp>().Where(x => x.FK_Emp == item && x.FK_Node == FK_Node).List().FirstOrDefault(); if (entity == null) { entity = new WF_NodeEmp() { FK_Node = FK_Node, FK_Emp = item }; entity.Save(); } } return(Json(new { success = true })); }
/// <summary> /// 保存关系Auth_Rlt_UserRole /// </summary> public ActionResult SaveRelation_UserRole(string RoleID, List <string> UserIDS) { foreach (var item in UserIDS) { var entity = NH.GetSession <Auth_Role>().QueryOver <Auth_Rlt_UserRole>().Where(x => x.UserID == item && x.RoleID == RoleID).List().FirstOrDefault(); if (entity == null) { entity = new Auth_Rlt_UserRole() { RoleID = RoleID, UserID = item }; entity.Save(); } } return(Json(new { success = true })); }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public ActionResult SaveDirection() { try { var entity = GetUpdateModel(null, "MYPK"); var list = NH.GetSession <WF_Direction>().QueryOver <WF_Direction>().Where(x => x.MyPK == entity.MyPK).List(); if (list.Count > 0) { throw new Exception("重复的连接线!"); } entity.SaveOrUpdate(); return(Json(new { success = true, entity = entity })); } catch (Exception ex) { return(Json(new { success = false, msg = "保存失败!" + ex.Message, error = JsonConvert.SerializeObject(ex) })); } }
public ActionResult LoadMyForm(string FK_Flow, int NodeID, int ToNodeID) { var entity = NH.GetSession <WF_Cond>().QueryOver <WF_Cond>().Where(x => x.NodeID == NodeID && x.ToNodeID == ToNodeID).List().FirstOrDefault(); if (entity == null) { entity = new WF_Cond() { FK_Flow = FK_Flow, NodeID = NodeID, ToNodeID = ToNodeID, CondType = (int)BP.WF.Template.CondType.Dir, DataFrom = (int)BP.WF.Template.ConnDataFrom.Paras, FK_Operator = "=", ConnJudgeWay = 0, PRI = 0, CondOrAnd = 0 }; } return(Json_Get(entity)); }