Example #1
0
        public static ReportTableField GetReportTableField(LoginUser loginUser, int reportTableFieldID)
        {
            ReportTableFields reportTableFields = new ReportTableFields(loginUser);

            reportTableFields.LoadByReportTableFieldID(reportTableFieldID);
            if (reportTableFields.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(reportTableFields[0]);
            }
        }
        public CustomPortalColumnProxy GetProxy()
        {
            CustomPortalColumnProxy result = new CustomPortalColumnProxy();

            result.CustomFieldID  = this.CustomFieldID;
            result.StockFieldID   = this.StockFieldID;
            result.Position       = this.Position;
            result.OrganizationID = this.OrganizationID;
            result.CustomColumnID = this.CustomColumnID;

            if (result.CustomFieldID != null)
            {
                CustomFields cf = new CustomFields(BaseCollection.LoginUser);
                cf.LoadByCustomFieldID((int)result.CustomFieldID);

                TicketTypes ticketTypes = new TicketTypes(BaseCollection.LoginUser);
                ticketTypes.LoadAllPositions(BaseCollection.LoginUser.OrganizationID);

                TicketType ticketType = ticketTypes.FindByTicketTypeID(cf[0].AuxID);
                if (ticketType == null)
                {
                    result.FieldText = cf[0].Name;
                }
                else
                {
                    result.FieldText = string.Format("{0} ({1})", cf[0].Name, ticketType.Name);
                }
            }
            else
            {
                ReportTableFields rt = new ReportTableFields(BaseCollection.LoginUser);
                rt.LoadByReportTableFieldID((int)result.StockFieldID);
                result.FieldText = rt[0].Alias;
            }



            return(result);
        }