public static int UpdateGroup(Group group) { int result = 0; EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(Global.jSSEConn); //Parameter Names if (group.Active == null) { group.Active = true; } string[] JsseParams = new[] { "GroupID", "GroupName", "GroupDesc", "GroupType", "MajorGroup_Id", "Org_Id", "PermissionIDs", "CreatedBy", "Active" }; try { var JsseValues = new object[] { group.Group_ID, group.GroupName, group.GroupDesc, group.GroupType.Level_Id, group.MajorGroup_Id, group.Org_Id, string.Join(",", group.Permissions.Where(p => p.Selected).Select(p => p.Permission_ID.ToString()).ToArray()), group.ModifiedBy, group.Active }; var jsseMain = DBGeneric.ExecStoredProcedure(entityBuilder.ProviderConnectionString, "dbo.[usp_JSSE_InsertUpdateSecurityGroup]", JsseParams, JsseValues); } catch { throw; } return(result); }
public IEnumerable <MajorGroupall> GetMajorGroup(string userId) { EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(Global.jSSEConn); var majorGroupResults = DBGeneric.ExecStoredProcedure <MajorGroupall>(entityBuilder.ProviderConnectionString, "usp_JSSE_MajorGroupByUserId", new[] { "UserId" }, new[] { userId }); return(majorGroupResults); }
public static int RemoveUserFromGroup(int groupId, int DbUserId) { int result = 0; EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(Global.jSSEConn); //Parameter Names string[] JsseParams = new[] { "GroupId", "DbUserId" }; try { var JsseValues = new object[] { groupId, DbUserId }; var jsseMain = DBGeneric.ExecStoredProcedure(entityBuilder.ProviderConnectionString, "dbo.[usp_JSSE_DeleteUserFromGroup]", JsseParams, JsseValues); } catch { throw; } return(result); }
public static int UpdateCategory(MasterCategory category) { int result = 0; EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(Global.jSSEConn); //Parameter Names string[] JsseParams = new[] { "CategoryID", "Category", "CategoryDesc", "CreatedBy", "Active" }; try { var JsseValues = new object[] { category.Category_ID, category.Category, category.CategoryDesc, category.ModifiedBy, category.IsActive }; var jsseMain = DBGeneric.ExecStoredProcedure(entityBuilder.ProviderConnectionString, "dbo.[usp_JSSE_InsertUpdateCategory]", JsseParams, JsseValues); } catch { throw; } return(result); }
public static int UpdateBehavior(MasterBehavior behavior) { int result = 0; EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(Global.jSSEConn); //Parameter Names string[] JsseParams = new[] { "BehaviorID", "Behavior", "BehaviorDesc", "CreatedBy", "Active", "CategoryID", "BehaviorTypeID", "MajorGroupID", "OrgID" }; try { var JsseValues = new object[] { behavior.Behavior_ID, behavior.Behavior, behavior.BehaviorDesc, behavior.ModifiedBy, behavior.IsActive, behavior.Category.Category_ID, behavior.BehaviorType.BehaviorType_ID, behavior.MajorGroup_ID, behavior.Org_ID }; var jsseMain = DBGeneric.ExecStoredProcedure(entityBuilder.ProviderConnectionString, "dbo.[usp_JSSE_InsertUpdateBehavior]", JsseParams, JsseValues); } catch { throw; } return(result); }
public static int AddUser(UserGroup group) { int result = 0; EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(Global.jSSEConn); string HierInfo = group.User.MajorGroup_Id + "," + group.User.Org_Id + "," + group.User.Dept_Id + "," + group.User.Section_Id; //Parameter Names string[] JsseParams = new[] { "GroupID", "UserID", "FirstName", "LastName", "EmpNo", "CompanyId", "HierarchyInfo", "CreatedBy" }; try { var JsseValues = new object[] { group.Group.Group_ID, group.User.User_ID, group.User.FirstName, group.User.LastName, group.User.Emp_Id, group.User.CompanyId, HierInfo, group.ModifiedBy }; var jsseMain = DBGeneric.ExecStoredProcedure(entityBuilder.ProviderConnectionString, "dbo.[usp_JSSE_InsertUpdateGroupUsers]", JsseParams, JsseValues); } catch { throw; } return(result); }