示例#1
0
        public virtual string GetUpdatingStatus(DateTime?history = null)
        {
            string status = "Done";

            if (history.HasValue)
            {
                var mpCustomerMarketplaceUpdatingHistory =
                    UpdatingHistory.FirstOrDefault(h => h.UpdatingStart >= history.Value);
                if (mpCustomerMarketplaceUpdatingHistory != null &&
                    !string.IsNullOrEmpty(mpCustomerMarketplaceUpdatingHistory.Error))
                {
                    status = "Error";
                }
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(UpdateError))
                {
                    status = "Error";
                }
                else if (UpdatingEnd != null)
                {
                    status = "Done";
                }
                else if (UpdatingStart != null)
                {
                    status = "In progress";
                }
                else
                {
                    status = "Never started";
                }
            }
            return(status);
        }
示例#2
0
        public virtual string GetUpdatingError(DateTime?history)
        {
            string error = null;

            if (history.HasValue)
            {
                var mpCustomerMarketplaceUpdatingHistory =
                    UpdatingHistory.FirstOrDefault(h => h.UpdatingStart >= history.Value);
                if (mpCustomerMarketplaceUpdatingHistory != null &&
                    !string.IsNullOrEmpty(mpCustomerMarketplaceUpdatingHistory.Error))
                {
                    error = mpCustomerMarketplaceUpdatingHistory.Error;
                }
            }
            else
            {
                error = UpdateError;
            }
            return(error);
        }