예제 #1
0
        internal static RolePermissionModel Mapping(USR_TMMA_ROLE_PERMISSION o)
        {
            try
            {
                if (o != null)
                {
                    return(new RolePermissionModel()
                    {
                        RolePermissionID = o.RolePermissionID,
                        RoleID = o.RoleID,
                        PermissionID = o.PermissionID,
                        IsActive = o.IsActive == 1,
                        CreatedBy = o.CreatedBy,
                        CreatedDate = o.CreatedDate,
                        UpdatedBy = o.UpdatedBy,
                        UpdatedDate = o.UpdatedDate,
                        Permission = MasterPermissionDAL.GetMasterPermission(o.PermissionID)
                    });
                }

                return(null);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        public static RolePermissionModel GetRolePermission(int rolePermissionID)
        {
            ACTION = "GetRolePermission(rolePermissionID)";

            try
            {
                using (UTMMABCDBEntities context = new UTMMABCDBEntities())
                {
                    USR_TMMA_ROLE_PERMISSION obj = context.USR_TMMA_ROLE_PERMISSION.Where(o => o.RolePermissionID == rolePermissionID).FirstOrDefault();
                    RolePermissionModel      m   = Mapping(obj);
                    return(m);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }