public SystemUser_RoleEntity ByRoleNameGetInfo(SystemUser_RoleEntity entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("ByRoleNameGetInfo");
     command.SetParameterValue("@RoleName", entity.RoleName);
     command.SetParameterValue("@SysNo", entity.SysNo);
     SystemUser_RoleEntity result = command.ExecuteEntity<SystemUser_RoleEntity>();
     return result;
 }
 public int ByRoleNameGetInfo(string roleName, string sysno)
 {
     int SysNo;
     int.TryParse(sysno, out SysNo);
     SystemUser_RoleEntity entity = new SystemUser_RoleEntity() { RoleName = roleName, SysNo = SysNo };
     SystemUser_RoleEntity cheEntity = SystemUser_RoleFacade.ByRoleNameGetInfo(entity);
     if (cheEntity == null || cheEntity.SysNo == 0)
     {
         return 1;
     }
     return 0;
 }
 public int Create(SystemUser_RoleEntity obj)
 {
     obj.InDate = DateTime.Now;
     obj.InUser = WebContext.LoginUser.UserName;
     obj.Status = 0;
     if (obj.SysNo == 0)
     {
         return SystemUser_RoleFacade.InsertSystemUser_Role(obj);
     }
     else
     {
         return SystemUser_RoleFacade.UpdateSystemUser_Role(obj);
     }
 }
 public int InsertSystemUser_Role(SystemUser_RoleEntity entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("InsertSystemUser_Role");
     command.SetParameterValue("@RoleName", entity.RoleName);
     command.SetParameterValue("@Status", entity.Status);
     command.SetParameterValue("@InUser", entity.InUser);
     command.SetParameterValue("@InDate", entity.InDate);
     object obj = command.ExecuteScalar();
     if (obj != null)
     {
         int sysno = Convert.ToInt32(obj);
         ClearSystemUser_Role_Privilege(sysno);
         //添加权限关联
         foreach (var item in entity.PrivilegeList)
         {
             InsertSystemUser_Role_Privilege(sysno, item.SysNo, entity.InUser);
         }
         return sysno;
     }
     else
         return 0;
 }
 public int UpdateSystemUser_Role(SystemUser_RoleEntity entity)
 {
     return ObjectFactory<ISystemUser_RoleDataAccess>.Instance.UpdateSystemUser_Role(entity);
 }
 public SystemUser_RoleEntity ByRoleNameGetInfo(SystemUser_RoleEntity entity)
 {
     return ObjectFactory<ISystemUser_RoleDataAccess>.Instance.ByRoleNameGetInfo(entity);
 }
 public int UpdateSystemUser_Role(SystemUser_RoleEntity entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("UpdateSystemUser_Role");
     command.SetParameterValue("@SysNo", entity.SysNo);
     command.SetParameterValue("@RoleName", entity.RoleName);
     command.SetParameterValue("@Status", entity.Status);
     command.SetParameterValue("@InUser", entity.InUser);
     command.SetParameterValue("@InDate", entity.InDate);
     int result = command.ExecuteNonQuery();
     //添加权限关联
     ClearSystemUser_Role_Privilege(entity.SysNo);
     foreach (var item in entity.PrivilegeList)
     {
         InsertSystemUser_Role_Privilege(entity.SysNo, item.SysNo, entity.InUser);
     }
     return result;
 }
Ejemplo n.º 8
0
 public static int UpdateSystemUser_Role(SystemUser_RoleEntity entity)
 {
     return RestClient.Post<int>("SystemUser_RoleService/UpdateSystemUser_Role", entity);
 }
Ejemplo n.º 9
0
 public static SystemUser_RoleEntity ByRoleNameGetInfo(SystemUser_RoleEntity entity)
 {
     return RestClient.Post<SystemUser_RoleEntity>("SystemUser_RoleService/ByRoleNameGetInfo", entity);
 }