示例#1
0
        private void buttonDownLoadPoNumber_Click(object sender, EventArgs e)
        {
            string errorMessage;

            int[] downloadedIDs;
            WebServiceAPIResult result = cfiClient.DownLoadOrdersToCacheByPONumber(this.textBoxDownLoadPONumber.Text.Trim(), true, true, 100, out errorMessage, out downloadedIDs);

            if (result == WebServiceAPIResult.Success)
            {
                appendMessage(string.Format("POs numbered {0} downloaded to cache", this.textBoxDownLoadPONumber.Text));

                foreach (int id in downloadedIDs)
                {
                    CacheOrder cachedOrder = cfiClient.Cache.GetOrder(id);
                    appendMessage(cachedOrder.ToXml());
                }
            }
            else if (result == WebServiceAPIResult.ConnectivityFail)
            {
                appendMessage(string.Format("POs numbered {0} Did not download because of a connection failure", this.textBoxDownLoadPONumber.Text));
            }
            else if (result == WebServiceAPIResult.Fail)
            {
                appendMessage(string.Format("POs numbered {0} not downloaded to cache.\r\n{1}", this.textBoxDownLoadPONumber.Text, errorMessage));
            }
        }
 internal ref FormattedReportLine[] GetLoadedReport(CacheOrder target)
 {
     switch (target)
     {
     case CacheOrder.BUILDING:
         if (m_cachedLoadedReport[(int)CacheOrder.BUILDING] == null)
         {
             if (m_colorConfigDataBuildings.Count + m_colorConfigDataBuildingsProps.Count + m_colorConfigDataBuildingsPropsGlobal.Count == 0)
             {
                 m_cachedLoadedReport[(int)CacheOrder.BUILDING] = new FormattedReportLine[0];
             }
             else
             {
                 var report = new Dictionary <string, List <FormattedReportLine> >();
                 foreach (KeyValuePair <string, BuildingAssetFolderRuleXml> entry in m_colorConfigDataBuildings)
                 {
                     (report.ContainsKey(entry.Key) ? report[entry.Key] : report[entry.Key] = new List <FormattedReportLine>()).Add(new FormattedReportLine("<Self>", entry.Value.Source));
                 }
                 foreach (KeyValuePair <string, PropAssetFolderRuleXml> entry in m_colorConfigDataBuildingsPropsGlobal)
                 {
                     (report.ContainsKey(entry.Key) ? report[entry.Key] : report[entry.Key] = new List <FormattedReportLine>()).Add(new FormattedReportLine("<Global prop>", entry.Value.Source));
                 }
                 foreach (KeyValuePair <string, Dictionary <string, PropAssetFolderRuleXml> > entry in m_colorConfigDataBuildingsProps)
                 {
                     foreach (KeyValuePair <string, PropAssetFolderRuleXml> subEntry in entry.Value)
                     {
                         (report.ContainsKey(entry.Key) ? report[entry.Key] : report[entry.Key] = new List <FormattedReportLine>()).Add(new FormattedReportLine("(Prop) " + subEntry.Key, subEntry.Value.Source));
                     }
                 }
                 m_cachedLoadedReport[(int)CacheOrder.BUILDING] = report.SelectMany(x => new FormattedReportLine[] { new FormattedReportLine(x.Key, null, 0) }.Union(x.Value)).ToArray();
             }
         }
         return(ref m_cachedLoadedReport[(int)CacheOrder.BUILDING]);