Example #1
0
        private GridData GetPaymentGridLocal(GridState state)
        {
            ValidationUtils.NotNull(state, "Неверное значение входного параметра.");

            var client = сlientService.CheckClientExistence(UserSession.CurrentClientAdministratorInfo.ClientAccountId);

            GridData model = new GridData();

            model.AddColumn("Number", "Номер платежного документа", Unit.Percentage(40));
            model.AddColumn("Date", "Дата", Unit.Pixel(60));
            model.AddColumn("Summa", "Сумма оплаты (руб.)", Unit.Pixel(90), align: GridColumnAlign.Right);
            model.AddColumn("Purpose", "Назначение платежа", Unit.Percentage(60));
            model.AddColumn("Id", "", Unit.Pixel(0), GridCellStyle.Hidden);

            model.State = state;

            return(model);
        }
Example #2
0
        private GridData GetCertificateOfCompletionGridLocal(GridState state)
        {
            ValidationUtils.NotNull(state, "Неверное значение входного параметра.");

            var client = сlientService.CheckClientExistence(UserSession.CurrentClientAdministratorInfo.ClientAccountId);

            GridData model = new GridData();

            model.AddColumn("Action", "Действие", Unit.Pixel(70));
            model.AddColumn("Number", "Номер документа", Unit.Percentage(40));
            model.AddColumn("Date", "Дата", Unit.Pixel(60));
            model.AddColumn("Summa", "Стоимость работ (руб.)", Unit.Pixel(90), align: GridColumnAlign.Right);
            model.AddColumn("Period", "Период выполнения работ", Unit.Percentage(60));
            model.AddColumn("Id", "", Unit.Pixel(0), GridCellStyle.Hidden);

            model.State = state;

            return(model);
        }
Example #3
0
        private GridData GetClientGridLocal(GridState state)
        {
            ValidationUtils.NotNull(state, "Неверное значение входного параметра.");

            GridData model = new GridData();

            //model.AddColumn("Action", "Действие", Unit.Pixel(70));
            model.AddColumn("Number", "№ акк.", Unit.Pixel(35), align: GridColumnAlign.Right);
            model.AddColumn("CreationDate", "Дата создания", Unit.Pixel(20));
            model.AddColumn("LastActivityDate", "Последняя активность", Unit.Pixel(60));
            model.AddColumn("Type", "Тип", Unit.Pixel(100));
            model.AddColumn("DisplayName", "Название", Unit.Percentage(40));
            model.AddColumn("AdminDisplayName", "ФИО администратора", Unit.Percentage(30));
            model.AddColumn("AdminEmail", "E-mail администратора", Unit.Pixel(100));
            model.AddColumn("Phone", "Телефон", Unit.Pixel(100));
            model.AddColumn("PromoCode", "Промокод", Unit.Pixel(60));
            model.AddColumn("PrepaymentSum", "Неизрасх. аванс (руб.)", Unit.Pixel(67), align: GridColumnAlign.Right);
            model.AddColumn("CurrentConfiguration", "Текущая конфигурация", Unit.Percentage(30));
            model.AddColumn("DBServerName", "Сервер БД", Unit.Pixel(65));
            model.AddColumn("DBName", "БД", Unit.Pixel(90));
            model.AddColumn("Id", "", Unit.Pixel(0), GridCellStyle.Hidden);

            model.State = state;

            var clientList = clientRepository.GetFilteredList(state);

            foreach (var client in clientList)
            {
                var actions = new GridActionCell("Action");
                actions.AddAction("Заблокировать", "block_link");

                var currentConfigurationName = "";
                var currentServiceSet        = client.ServiceSets.Where(x => x.IsCurrent).FirstOrDefault();

                if (currentServiceSet != null)
                {
                    currentConfigurationName = currentServiceSet.Configuration.Name;
                }

                GridRowStyle style = GridRowStyle.Normal;
                // не заходили больше недели
                if ((DateTime.Now - client.LastActivityDate).Days > 7)
                {
                    style = GridRowStyle.Error;
                }
                // зарегистрированы сегодня
                if (client.CreationDate.Date == DateTime.Today)
                {
                    style = GridRowStyle.Success;
                }

                model.AddRow(new GridRow(
                                 //actions,
                                 new GridLabelCell("Number")
                {
                    Value = client.Number.ForDisplay()
                },
                                 new GridLabelCell("CreationDate")
                {
                    Value = client.CreationDate.ToShortDateString() + " " + client.CreationDate.ToShortTimeString()
                },
                                 new GridLabelCell("LastActivityDate")
                {
                    Value = client.LastActivityDate.ToShortDateString() + " " + client.LastActivityDate.ToShortTimeString()
                },
                                 new GridLabelCell("Type")
                {
                    Value = client.Type.GetDisplayName()
                },
                                 new GridLabelCell("DisplayName")
                {
                    Value = client.DisplayName
                },
                                 new GridLabelCell("AdminDisplayName")
                {
                    Value = client.Users.First(x => x.IsClientAdmin).DisplayName
                },
                                 new GridLabelCell("AdminEmail")
                {
                    Value = client.AdminEmail
                },
                                 new GridLabelCell("Phone")
                {
                    Value = client.Phone
                },
                                 new GridLabelCell("PromoCode")
                {
                    Value = client.PromoCode
                },
                                 new GridLabelCell("PrepaymentSum")
                {
                    Value = client.PrepaymentSum.ForDisplay()
                },
                                 new GridLabelCell("CurrentConfiguration")
                {
                    Value = currentConfigurationName
                },
                                 new GridLabelCell("DBServerName")
                {
                    Value = client.DBServerName
                },
                                 new GridLabelCell("DBName")
                {
                    Value = client.DBName
                },
                                 new GridHiddenCell("Id")
                {
                    Value = client.Id.ToString()
                }
                                 )
                {
                    Style = style
                });
            }

            return(model);
        }