Exemplo n.º 1
0
        public static async Task <List <CtbSubMenuItem> > GetSubMenuItemsAsync(
            SubMenuItemsRequest subMenuRequest)
        {
            List <CtbSubMenuItem> subMenuItemsAsync = await CartableManager.ctbHandler.GetSubMenuItemsAsync(subMenuRequest);

            return(subMenuItemsAsync);
        }
Exemplo n.º 2
0
        public async Task <HttpResponseMessage> GetSubMenuItems([FromBody] SubMenuItemsRequest request)
        {
            try
            {
                SecurityManager.ThrowIfUserContextNull();

                if (!request.RoleId.HasValue)
                {
                    if (SecurityManager.CurrentUserContext.IsOperatorPersonnelUser())// || SecurityManager.CurrentUserContext.IsKargozariPersonnelUser())
                    {
                        request.RoleId = SecurityManager.CurrentUserContext.Roles[0].RoleID;
                    }

                    else
                    {
                        throw new OMFValidationException("نقش یا سمت کاربر مشخص نمی باشد");
                    }
                }

                if (!request.UserId.HasValue)
                {
                    request.UserId = SecurityManager.CurrentUserContext.UserId;
                }

                List <CtbSubMenuItem> subMenuItems = new List <CtbSubMenuItem>();
                subMenuItems = await CartableManager.GetSubMenuItemsAsync(request);

                return(Request.CreateResponse(HttpStatusCode.OK, new { resultCode = (int)ResultCode.Successful, data = subMenuItems }));
            }
            catch (Exception ex)
            {
                return(await this.HandleExceptionAsync(ex));
            }
        }
Exemplo n.º 3
0
 public static List <CtbSubMenuItem> GetSubMenuItems(
     SubMenuItemsRequest subMenuRequest)
 {
     return(CartableManager.ctbHandler.GetSubMenuItems(subMenuRequest));
 }