Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
        internal static List <RolePermissionModel> Mapping(List <USR_TMMA_ROLE_PERMISSION> list)
        {
            ACTION = "Mapping(List<USR_TMMA_ROLE_PERMISSION>)";

            try
            {
                if (list != null && list.Count > 0)
                {
                    List <RolePermissionModel> mList = new List <RolePermissionModel>();

                    foreach (USR_TMMA_ROLE_PERMISSION o in list)
                    {
                        mList.Add(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(mList);
                }

                return(null);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }