public ForActionReportModel(ServicesProxy servicesProxy, string id = null)
        {
            Header              = new ForActionReportTableItem();
            PostReportParams    = new ForActionReportParams();
            groupContactsResult = servicesProxy.TicketService.GetGroupContacts();
            groupContactsResult.GroupContacts = groupContactsResult.GroupContacts
                                                .Where(c => !c.IsUnassigned || (c.IsUnassigned && servicesProxy.RequestState.UserDetails.CanViewUnassigned))
                                                .OrderBy(c => c.Description).ToList();

            if (servicesProxy.RequestState != null && servicesProxy.RequestState.UserDetails != null)
            {
                servicesProxy.RequestState.UserDetails.GroupContact = groupContactsResult.GetGroupContact(servicesProxy.RequestState.UserDetails.GroupContact.Code);
                SelectedGroupContact = !string.IsNullOrEmpty(id)
                    ? groupContactsResult.GetGroupContact(id)
                    : servicesProxy.RequestState.UserDetails.GroupContact;
            }

            if (SelectedGroupContact == null)
            {
                SelectedGroupContact = groupContactsResult.GetGroupContact("0");
            }

            ReportParams = new ForActionReportParams
            {
                GroupContact = SelectedGroupContactValue
            };

            Result = servicesProxy.ReportService.ForActionReport(ReportParams);
        }
示例#2
0
        public EditGroupContactModel(ServicesProxy servicesProxy, string id)
        {
            groupContactsResult = servicesProxy.TicketService.GetGroupContacts(true);
            if (!groupContactsResult.OK)
            {
                return;
            }

            GroupContact = groupContactsResult.GetGroupContact(id);
            IsVisible    = GroupContact.IsVisible.GetValueOrDefault();
        }