예제 #1
0
        public OrderSearchBlock(string page)
        {
            var helper = new PermissionHelper();

            Page = page;
            switch (page)
            {
            case "Common":
            default:
                Title   = "Список заказов";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = false,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = false,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = false,
                    AddViewName             = "",
                    AddControllerName       = "",
                    HideRegionFilter        = false
                };
                HasPermission = helper.HasPermission(Permissions.OrderListView);
                break;

            case "StatConstructor":
                Title   = "Поиск заказов";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = false,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = false,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = false,
                    HideCreateOrderBtn      = true,
                    AddViewName             = "",
                    AddControllerName       = "",
                    HideExportMenu          = true,
                    HideSpamSend            = true,
                    HideStatusChange        = true,
                    HideStatSave            = false,
                    HideRegionFilter        = true
                };
                HasPermission = helper.HasPermission(Permissions.OrderListView);
                break;


            case "Overage":

                Title   = "Заказы с оценкой за 2 недели";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = false,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "Quality",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.OrderListView);
                break;

            case "StatCommon":

                Title   = "Общая статистика";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "Common",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.StatCommon);
                break;

            case "StatQuality":

                Title   = "Общая статистика";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "Quality",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.StatQuality);
                break;

            case "StatStatus":

                Title   = "Статистика по статусам заказов";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "Status",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.StatStatus);
                break;

            case "StatOrderVolume":

                Title   = "Статистика по объему заказов";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "OrderVolume",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.StatOrderVolume);
                break;

            case "StatOrderAmount":

                Title   = "Статистика по количеству заказов";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "OrderAmount",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.StatOrderAmount);
                break;

            case "StatMiddlePrice":

                Title   = "Статистика по среднему чеку";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "MiddlePrice",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.StatMiddlePrice);
                break;

            case "StatClientsCompare":

                Title   = "Стастистика удовлетворенности клиентов";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = true,
                    HideCreateRangeFilter   = false,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = true,
                    HideActionMenu          = true,
                    AddViewName             = "ClientsCompare",
                    AddControllerName       = "Graph",
                    HideRegionFilter        = true
                };

                HasPermission = helper.HasPermission(Permissions.StatClientsCompare);
                break;

            case "Delivery":

                Title   = "Заказы для доставки";
                Options = new OrderSearchTableOptions()
                {
                    HideCheckBoxes          = false,
                    HideCreateRangeFilter   = true,
                    HideDeliveryRangeFilter = true,
                    HideShopFilter          = false,
                    HideFilter = false,
                    HideDeliveryExactFilter = false,
                    HideActionMenu          = false,
                    HideBody               = true,
                    AddViewNameLower       = "OrderMap",
                    AddControllerNameLower = "Delivery",
                    HideRegionFilter       = true,
                    SMSTemplate            = "",
                    EmailTemplate          = "DeliveryLetter",
                    SkipAutoPost           = true
                };

                HasPermission = helper.HasPermission(Permissions.StatClientsCompare);
                break;
            }
            Options.Page = page;
        }