Exemple #1
0
        public static string GetTicketSeverities(RestCommand command, bool orderByDateCreated = false)
        {
            TicketSeverities items = new TicketSeverities(command.LoginUser);

            if (orderByDateCreated)
            {
                items.LoadByOrganizationID(command.Organization.OrganizationID, "DateCreated DESC");
            }
            else
            {
                items.LoadByOrganizationID(command.Organization.OrganizationID);
            }
            return(items.GetXml("TicketSeverities", "TicketSeverity", true, command.Filters));
        }
Exemple #2
0
        public static string GetTicketSeverities(RestCommand command)
        {
            TicketSeverities ticketSeverities = new TicketSeverities(command.LoginUser);

            ticketSeverities.LoadByOrganizationID(command.Organization.OrganizationID);

            if (command.Format == RestFormat.XML)
            {
                return(ticketSeverities.GetXml("TicketSeverities", "TicketSeverity", true, command.Filters));
            }
            else
            {
                throw new RestException(HttpStatusCode.BadRequest, "Invalid data format");
            }
        }
Exemple #3
0
        public AutomationData GetData()
        {
            AutomationData result = new AutomationData();
            TicketAutomationPossibleActions actions = new TicketAutomationPossibleActions(UserSession.LoginUser);

            actions.LoadActive();
            result.Actions = actions.GetTicketAutomationPossibleActionProxies();


            List <AutoFieldItem> fieldItems = new List <AutoFieldItem>();
            ReportTableFields    fields     = new ReportTableFields(TSAuthentication.GetLoginUser());

            fields.LoadByReportTableID(10);

            CustomFields customs = new CustomFields(fields.LoginUser);

            customs.LoadByReferenceType(TSAuthentication.OrganizationID, ReferenceType.Tickets);

            CustomFields orgfields = new CustomFields(fields.LoginUser);

            orgfields.LoadByReferenceType(TSAuthentication.OrganizationID, ReferenceType.Organizations);
            List <string> orgCustomFields = new List <string>();

            foreach (CustomField c in orgfields)
            {
                orgCustomFields.Add(c.Name + ":" + c.CustomFieldID);
            }


            TicketTypes ticketTypes = new TicketTypes(fields.LoginUser);

            ticketTypes.LoadAllPositions(TSAuthentication.OrganizationID);

            foreach (ReportTableField field in fields)
            {
                fieldItems.Add(new AutoFieldItem(field));
            }

            List <AutoFieldItem> customFieldsItems = new List <AutoFieldItem>();

            foreach (CustomField custom in customs)
            {
                TicketType ticketType = ticketTypes.FindByTicketTypeID(custom.AuxID);
                if (ticketType == null)
                {
                    fieldItems.Add(new AutoFieldItem(custom));
                    customFieldsItems.Add(new AutoFieldItem(custom));
                }
                else
                {
                    fieldItems.Add(new AutoFieldItem(custom, string.Format("{0} ({1})", custom.Name, ticketType.Name)));
                    customFieldsItems.Add(new AutoFieldItem(custom, string.Format("{0} ({1})", custom.Name, ticketType.Name)));
                }
            }
            result.CustomFields = customFieldsItems.ToArray();

            ReportTableField actionsViewDescription = ReportTableFields.GetReportTableField(fields.LoginUser, 6);

            actionsViewDescription.Alias = "Action Text";
            fieldItems.Add(new AutoFieldItem(actionsViewDescription));

            ReportTableField actionsViewName = ReportTableFields.GetReportTableField(fields.LoginUser, 5);

            fieldItems.Add(new AutoFieldItem(actionsViewName));

            ReportTableField actionsViewType = ReportTableFields.GetReportTableField(fields.LoginUser, 18);

            fieldItems.Add(new AutoFieldItem(actionsViewType));

            AutoFieldItem afiDayOfWeekCreated = new AutoFieldItem();

            afiDayOfWeekCreated.Alias         = "Day of Week Created";
            afiDayOfWeekCreated.DataType      = "list";
            afiDayOfWeekCreated.FieldID       = 101001;
            afiDayOfWeekCreated.FieldName     = "Day of Week Created";
            afiDayOfWeekCreated.IsCustom      = false;
            afiDayOfWeekCreated.IsVisible     = true;
            afiDayOfWeekCreated.ListValues    = new string[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
            afiDayOfWeekCreated.LookupTableID = null;
            afiDayOfWeekCreated.Size          = 0;
            afiDayOfWeekCreated.Description   = "";
            afiDayOfWeekCreated.TableID       = -2;
            afiDayOfWeekCreated.RefType       = ReferenceType.Tickets;
            afiDayOfWeekCreated.AuxID         = null;
            afiDayOfWeekCreated.OtherTrigger  = "ticketsview.dayofweekcreated";
            fieldItems.Add(afiDayOfWeekCreated);

            AutoFieldItem afiHourOfDayCreated = new AutoFieldItem();

            afiHourOfDayCreated.Alias         = "Hour of Day Created";
            afiHourOfDayCreated.DataType      = "text";
            afiHourOfDayCreated.FieldID       = 101002;
            afiHourOfDayCreated.FieldName     = "Hour of Day Created";
            afiHourOfDayCreated.IsCustom      = false;
            afiHourOfDayCreated.IsVisible     = true;
            afiHourOfDayCreated.ListValues    = null;
            afiHourOfDayCreated.LookupTableID = null;
            afiHourOfDayCreated.Size          = 0;
            afiHourOfDayCreated.Description   = "";
            afiHourOfDayCreated.TableID       = -2;
            afiHourOfDayCreated.RefType       = ReferenceType.Tickets;
            afiHourOfDayCreated.AuxID         = null;
            afiHourOfDayCreated.OtherTrigger  = "ticketsview.hourofdaycreated";
            fieldItems.Add(afiHourOfDayCreated);

            AutoFieldItem afiMinSinceLastAction = new AutoFieldItem();

            afiMinSinceLastAction.Alias         = "Minutes Since last Action Added";
            afiMinSinceLastAction.DataType      = "text";
            afiMinSinceLastAction.FieldID       = 101003;
            afiMinSinceLastAction.FieldName     = "Minutes Since last Action Added";
            afiMinSinceLastAction.IsCustom      = false;
            afiMinSinceLastAction.IsVisible     = true;
            afiMinSinceLastAction.ListValues    = null;
            afiMinSinceLastAction.LookupTableID = null;
            afiMinSinceLastAction.Size          = 0;
            afiMinSinceLastAction.Description   = "";
            afiMinSinceLastAction.TableID       = -2;
            afiMinSinceLastAction.RefType       = ReferenceType.Tickets;
            afiMinSinceLastAction.AuxID         = null;
            afiMinSinceLastAction.OtherTrigger  = "ticketsview.minutessincelastactionadded";
            fieldItems.Add(afiMinSinceLastAction);

            AutoFieldItem afiHoursSinceAction = new AutoFieldItem();

            afiHoursSinceAction.Alias         = "Hours Since Last Action Added";
            afiHoursSinceAction.DataType      = "text";
            afiHoursSinceAction.FieldID       = 101004;
            afiHoursSinceAction.FieldName     = "Hours Since Last Action Added";
            afiHoursSinceAction.IsCustom      = false;
            afiHoursSinceAction.IsVisible     = true;
            afiHoursSinceAction.ListValues    = null;
            afiHoursSinceAction.LookupTableID = null;
            afiHoursSinceAction.Size          = 0;
            afiHoursSinceAction.Description   = "";
            afiHoursSinceAction.TableID       = -2;
            afiHoursSinceAction.RefType       = ReferenceType.Tickets;
            afiHoursSinceAction.AuxID         = null;
            afiHoursSinceAction.OtherTrigger  = "ticketsview.hourssincelastactionadded";
            fieldItems.Add(afiHoursSinceAction);

            AutoFieldItem afiCurrentDayOfWeek = new AutoFieldItem();

            afiCurrentDayOfWeek.Alias         = "Current Day of Week";
            afiCurrentDayOfWeek.DataType      = "list";
            afiCurrentDayOfWeek.FieldID       = 101005;
            afiCurrentDayOfWeek.FieldName     = "Current Day of Week";
            afiCurrentDayOfWeek.IsCustom      = false;
            afiCurrentDayOfWeek.IsVisible     = true;
            afiCurrentDayOfWeek.ListValues    = new string[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
            afiCurrentDayOfWeek.LookupTableID = null;
            afiCurrentDayOfWeek.Size          = 0;
            afiCurrentDayOfWeek.Description   = "";
            afiCurrentDayOfWeek.TableID       = -2;
            afiCurrentDayOfWeek.RefType       = ReferenceType.Tickets;
            afiCurrentDayOfWeek.AuxID         = null;
            afiCurrentDayOfWeek.OtherTrigger  = "ticketsview.currentdayofweek";
            fieldItems.Add(afiCurrentDayOfWeek);

            AutoFieldItem afiCurrentHourOfDay = new AutoFieldItem();

            afiCurrentHourOfDay.Alias         = "Current Hour of Day";
            afiCurrentHourOfDay.DataType      = "text";
            afiCurrentHourOfDay.FieldID       = 101006;
            afiCurrentHourOfDay.FieldName     = "Current Hour of Day";
            afiCurrentHourOfDay.IsCustom      = false;
            afiCurrentHourOfDay.IsVisible     = true;
            afiCurrentHourOfDay.ListValues    = null;
            afiCurrentHourOfDay.LookupTableID = null;
            afiCurrentHourOfDay.Size          = 0;
            afiCurrentHourOfDay.Description   = "";
            afiCurrentHourOfDay.TableID       = -2;
            afiCurrentHourOfDay.RefType       = ReferenceType.Tickets;
            afiCurrentHourOfDay.AuxID         = null;
            afiCurrentHourOfDay.OtherTrigger  = "ticketsview.currenthourofday";
            fieldItems.Add(afiCurrentHourOfDay);

            AutoFieldItem afiAssignedUserIsAvailable = new AutoFieldItem();

            afiAssignedUserIsAvailable.Alias         = "Assigned User Is Available";
            afiAssignedUserIsAvailable.DataType      = "bit";
            afiAssignedUserIsAvailable.FieldID       = 101007;
            afiAssignedUserIsAvailable.FieldName     = "Assigned User Is Available";
            afiAssignedUserIsAvailable.IsCustom      = false;
            afiAssignedUserIsAvailable.IsVisible     = true;
            afiAssignedUserIsAvailable.ListValues    = null;
            afiAssignedUserIsAvailable.LookupTableID = null;
            afiAssignedUserIsAvailable.Size          = 0;
            afiAssignedUserIsAvailable.Description   = "";
            afiAssignedUserIsAvailable.TableID       = -2;
            afiAssignedUserIsAvailable.RefType       = ReferenceType.Tickets;
            afiAssignedUserIsAvailable.AuxID         = null;
            afiAssignedUserIsAvailable.OtherTrigger  = "ticketsview.assigneduseravailable";
            fieldItems.Add(afiAssignedUserIsAvailable);

            AutoFieldItem afiAssignedUserIsBusy = new AutoFieldItem();

            afiAssignedUserIsBusy.Alias         = "Assigned User Is Busy";
            afiAssignedUserIsBusy.DataType      = "bit";
            afiAssignedUserIsBusy.FieldID       = 101008;
            afiAssignedUserIsBusy.FieldName     = "Assigned User Is Busy";
            afiAssignedUserIsBusy.IsCustom      = false;
            afiAssignedUserIsBusy.IsVisible     = true;
            afiAssignedUserIsBusy.ListValues    = null;
            afiAssignedUserIsBusy.LookupTableID = null;
            afiAssignedUserIsBusy.Size          = 0;
            afiAssignedUserIsBusy.Description   = "";
            afiAssignedUserIsBusy.TableID       = -2;
            afiAssignedUserIsBusy.RefType       = ReferenceType.Tickets;
            afiAssignedUserIsBusy.AuxID         = null;
            afiAssignedUserIsBusy.OtherTrigger  = "ticketsview.assignedusernotavailable";
            fieldItems.Add(afiAssignedUserIsBusy);

            AutoFieldItem afiAgentRatings = new AutoFieldItem();

            afiAgentRatings.Alias         = "Agent Rating";
            afiAgentRatings.DataType      = "list";
            afiAgentRatings.FieldID       = 101009;
            afiAgentRatings.FieldName     = "AgentRating";
            afiAgentRatings.IsCustom      = false;
            afiAgentRatings.IsVisible     = true;
            afiAgentRatings.ListValues    = new string[] { "Positive", "Negative", "Neutral" };
            afiAgentRatings.LookupTableID = null;
            afiAgentRatings.Size          = 0;
            afiAgentRatings.Description   = "";
            afiAgentRatings.TableID       = -2;
            afiAgentRatings.RefType       = ReferenceType.Tickets;
            afiAgentRatings.AuxID         = null;
            afiAgentRatings.OtherTrigger  = "ticketsview.AgentRating";
            fieldItems.Add(afiAgentRatings);

            AutoFieldItem afiCDIValue = new AutoFieldItem();

            afiCDIValue.Alias         = "Customer CDI Value";
            afiCDIValue.DataType      = "text";
            afiCDIValue.FieldID       = 101010;
            afiCDIValue.FieldName     = "Customer CDI Value";
            afiCDIValue.IsCustom      = false;
            afiCDIValue.IsVisible     = true;
            afiCDIValue.ListValues    = null;
            afiCDIValue.LookupTableID = null;
            afiCDIValue.Size          = 0;
            afiCDIValue.Description   = "";
            afiCDIValue.TableID       = -2;
            afiCDIValue.RefType       = ReferenceType.Tickets;
            afiCDIValue.AuxID         = null;
            afiCDIValue.OtherTrigger  = "organizations.cdivalue";
            fieldItems.Add(afiCDIValue);

            AutoFieldItem afiCDITrend = new AutoFieldItem();

            afiCDITrend.Alias         = "Customer CDI Trend";
            afiCDITrend.DataType      = "text";
            afiCDITrend.FieldID       = 101011;
            afiCDITrend.FieldName     = "Customer CDI Trend";
            afiCDITrend.IsCustom      = false;
            afiCDITrend.IsVisible     = true;
            afiCDITrend.ListValues    = new string[] { "1", "0", "-1" };;
            afiCDITrend.LookupTableID = null;
            afiCDITrend.Size          = 0;
            afiCDITrend.Description   = "";
            afiCDITrend.TableID       = -2;
            afiCDITrend.RefType       = ReferenceType.Tickets;
            afiCDITrend.AuxID         = null;
            afiCDITrend.OtherTrigger  = "organizations.cditrend";
            fieldItems.Add(afiCDITrend);

            AutoFieldItem afiServiceLevelName = new AutoFieldItem();

            afiServiceLevelName.Alias         = "Service Level Name";
            afiServiceLevelName.DataType      = "text";
            afiServiceLevelName.FieldID       = 101012;
            afiServiceLevelName.FieldName     = "Service Level Name";
            afiServiceLevelName.IsCustom      = false;
            afiServiceLevelName.IsVisible     = true;
            afiServiceLevelName.ListValues    = null;
            afiServiceLevelName.LookupTableID = null;
            afiServiceLevelName.Size          = 0;
            afiServiceLevelName.Description   = "";
            afiServiceLevelName.TableID       = -2;
            afiServiceLevelName.RefType       = ReferenceType.Tickets;
            afiServiceLevelName.AuxID         = null;
            afiServiceLevelName.OtherTrigger  = "organizations.SLAName";
            fieldItems.Add(afiServiceLevelName);

            AutoFieldItem afiServiceExpirationDate = new AutoFieldItem();

            afiServiceExpirationDate.Alias         = "Service Expiration Date";
            afiServiceExpirationDate.DataType      = "datetime";
            afiServiceExpirationDate.FieldID       = 101013;
            afiServiceExpirationDate.FieldName     = "Service Expiration Date";
            afiServiceExpirationDate.IsCustom      = false;
            afiServiceExpirationDate.IsVisible     = true;
            afiServiceExpirationDate.ListValues    = null;
            afiServiceExpirationDate.LookupTableID = null;
            afiServiceExpirationDate.Size          = 0;
            afiServiceExpirationDate.Description   = "";
            afiServiceExpirationDate.TableID       = -2;
            afiServiceExpirationDate.RefType       = ReferenceType.Tickets;
            afiServiceExpirationDate.AuxID         = null;
            afiServiceExpirationDate.OtherTrigger  = "organizations.serviceexpirationdate";
            fieldItems.Add(afiServiceExpirationDate);

            AutoFieldItem afiCustomerIsActive = new AutoFieldItem();

            afiCustomerIsActive.Alias         = "Customer Is Active";
            afiCustomerIsActive.DataType      = "bit";
            afiCustomerIsActive.FieldID       = 101014;
            afiCustomerIsActive.FieldName     = "Customer Is Active";
            afiCustomerIsActive.IsCustom      = false;
            afiCustomerIsActive.IsVisible     = true;
            afiCustomerIsActive.ListValues    = null;
            afiCustomerIsActive.LookupTableID = null;
            afiCustomerIsActive.Size          = 0;
            afiCustomerIsActive.Description   = "";
            afiCustomerIsActive.TableID       = -2;
            afiCustomerIsActive.RefType       = ReferenceType.Tickets;
            afiCustomerIsActive.AuxID         = null;
            afiCustomerIsActive.OtherTrigger  = "organizations.active";
            fieldItems.Add(afiCustomerIsActive);

            AutoFieldItem afiCustomerCustomValue = new AutoFieldItem();

            afiCustomerCustomValue.Alias         = "Customer Custom Value";
            afiCustomerCustomValue.DataType      = "text";
            afiCustomerCustomValue.FieldID       = -999;
            afiCustomerCustomValue.FieldName     = "Customer Custom Value";
            afiCustomerCustomValue.IsCustom      = false;
            afiCustomerCustomValue.IsVisible     = true;
            afiCustomerCustomValue.ListValues    = orgCustomFields.ToArray();
            afiCustomerCustomValue.LookupTableID = null;
            afiCustomerCustomValue.Size          = 0;
            afiCustomerCustomValue.Description   = "";
            afiCustomerCustomValue.TableID       = -2;
            afiCustomerCustomValue.RefType       = ReferenceType.Tickets;
            afiCustomerCustomValue.AuxID         = null;
            afiCustomerCustomValue.OtherTrigger  = "organizations.customvalue";
            fieldItems.Add(afiCustomerCustomValue);

            AutoFieldItem afiCustomerServiceExpired = new AutoFieldItem();

            afiCustomerServiceExpired.Alias         = "Customer Service Expired";
            afiCustomerServiceExpired.DataType      = "bit";
            afiCustomerServiceExpired.FieldID       = 101015;
            afiCustomerServiceExpired.FieldName     = "Customer Service Expired";
            afiCustomerServiceExpired.IsCustom      = false;
            afiCustomerServiceExpired.IsVisible     = true;
            afiCustomerServiceExpired.ListValues    = null;
            afiCustomerServiceExpired.LookupTableID = null;
            afiCustomerServiceExpired.Size          = 0;
            afiCustomerServiceExpired.Description   = "";
            afiCustomerServiceExpired.TableID       = -2;
            afiCustomerServiceExpired.RefType       = ReferenceType.Tickets;
            afiCustomerServiceExpired.AuxID         = null;
            afiCustomerServiceExpired.OtherTrigger  = "organizations.serviceexpired";
            fieldItems.Add(afiCustomerServiceExpired);

            result.Fields = fieldItems.ToArray();

            Users users = new Users(UserSession.LoginUser);

            users.LoadByOrganizationID(UserSession.LoginUser.OrganizationID, true);
            List <AutocompleteItem> userItems = new List <AutocompleteItem>();

            foreach (User user in users)
            {
                userItems.Add(new AutocompleteItem(user.DisplayName, user.UserID.ToString()));
            }
            result.Users = userItems.ToArray();

            Groups groups = new Groups(UserSession.LoginUser);

            groups.LoadByOrganizationID(UserSession.LoginUser.OrganizationID);
            List <AutocompleteItem> groupItems = new List <AutocompleteItem>();

            foreach (Group group in groups)
            {
                groupItems.Add(new AutocompleteItem(group.Name, group.GroupID.ToString()));
            }
            result.Groups = groupItems.ToArray();

            TicketSeverities severities = new TicketSeverities(UserSession.LoginUser);

            severities.LoadByOrganizationID(UserSession.LoginUser.OrganizationID);
            List <AutocompleteItem> severityItems = new List <AutocompleteItem>();

            foreach (TicketSeverity severity in severities)
            {
                severityItems.Add(new AutocompleteItem(severity.Name, severity.TicketSeverityID.ToString()));
            }
            result.Severities = severityItems.ToArray();

            List <AutocompleteItem> statusItems = new List <AutocompleteItem>();

            List <AutocompleteItem> ticketTypeItems = new List <AutocompleteItem>();

            foreach (TicketType ticketType in ticketTypes)
            {
                ticketTypeItems.Add(new AutocompleteItem(ticketType.Name, ticketType.TicketTypeID.ToString()));


                TicketStatuses statuses = new TicketStatuses(UserSession.LoginUser);
                statuses.LoadAllPositions(ticketType.TicketTypeID);

                foreach (TicketStatus status in statuses)
                {
                    statusItems.Add(new AutocompleteItem(ticketType.Name + " - " + status.Name, status.TicketStatusID.ToString()));
                }
            }
            result.Statuses    = statusItems.ToArray();
            result.TicketTypes = ticketTypeItems.ToArray();
            return(result);
        }
Exemple #4
0
        private void ImportOrg(int orgID, LoginUser loginUser)
        {
            string existingImportID = GetImportID(orgID);

            if (!string.IsNullOrWhiteSpace(existingImportID))
            {
                MessageBox.Show("This company has already been imported");
                return;
            }

            try
            {
                _importID         = orgID.ToString() + "-" + Guid.NewGuid().ToString();
                _logs             = new Logs(orgID.ToString() + " - Org.txt");
                _usersAndContacts = new Users(loginUser);
                _usersAndContacts.LoadContactsAndUsers(orgID, false);

                _badProducts           = new Products(GetCorrupteLoginUser());
                _badProductVersions    = new ProductVersions(GetCorrupteLoginUser());
                _badGroups             = new Groups(GetCorrupteLoginUser());
                _badUsers              = new Users(GetCorrupteLoginUser());
                _badTicketTypes        = new TicketTypes(GetCorrupteLoginUser());
                _badTicketStatuses     = new TicketStatuses(GetCorrupteLoginUser());
                _badTicketSeverities   = new TicketSeverities(GetCorrupteLoginUser());
                _badTicketKBCategories = new KnowledgeBaseCategories(GetCorrupteLoginUser());
                _badProducts.LoadByOrganizationID(orgID);
                _badProductVersions.LoadByParentOrganizationID(orgID);
                _badGroups.LoadByOrganizationID(orgID);
                _badUsers.LoadByOrganizationID(orgID, false);
                _badTicketTypes.LoadByOrganizationID(orgID);
                _badTicketStatuses.LoadByOrganizationID(orgID);
                _badTicketSeverities.LoadByOrganizationID(orgID);
                _badTicketKBCategories.LoadCategories(orgID);

                _goodProducts           = new Products(loginUser);
                _goodProductVersions    = new ProductVersions(loginUser);
                _goodGroups             = new Groups(loginUser);
                _goodUsers              = new Users(loginUser);
                _goodTicketTypes        = new TicketTypes(loginUser);
                _goodTicketStatuses     = new TicketStatuses(loginUser);
                _goodTicketSeverities   = new TicketSeverities(loginUser);
                _goodTicketKBCategories = new KnowledgeBaseCategories(loginUser);

                _goodProducts.LoadByOrganizationID(orgID);
                _goodProductVersions.LoadByParentOrganizationID(orgID);
                _goodGroups.LoadByOrganizationID(orgID);
                _goodUsers.LoadByOrganizationID(orgID, false);
                _goodTicketTypes.LoadByOrganizationID(orgID);
                _goodTicketStatuses.LoadByOrganizationID(orgID);
                _goodTicketSeverities.LoadByOrganizationID(orgID);
                _goodTicketKBCategories.LoadCategories(orgID);


                _exceptionOcurred = false;
                if (cbCompanies.Checked)
                {
                    RecoverCompanies(orgID, loginUser);
                }
                //RecoverContacts(orgID);
                if (cbProducts.Checked)
                {
                    RecoverProducts(orgID, loginUser);
                }
                // RecoverAssets(orgID);
                if (cbOldActions.Checked)
                {
                    RecoverActionsFromOldTickets(orgID, loginUser);
                }
                if (cbTickets.Checked)
                {
                    RecoverTickets(orgID, loginUser);
                }

                if (_exceptionOcurred)
                {
                    SaveOrgResults(orgID, "Finished with exceptions", _importID);
                }
                else
                {
                    SaveOrgResults(orgID, "Success", _importID);
                }
                SqlExecutor.ExecuteNonQuery(loginUser, "update organizations set LastIndexRebuilt='1/1/2000' where OrganizationID=" + orgID.ToString());
                MessageBox.Show("Import Complete");
            }
            catch (Exception ex)
            {
                SaveOrgResults(orgID, "Failure: " + ex.Message, _importID);
                ExceptionLogs.LogException(GetCorrupteLoginUser(), ex, "recover");
            }
        }