Пример #1
0
        //这个就是把界面上的查询条件(后来存入了 mListUCConditionItems 里面),放到mListQueryConditionDetails里面
        private void CreateConditionResultList()
        {
            try
            {
                ListTransParams.Clear();
                StatisticParam SP = GetValueFromPage();
                if (SP.StatisticalParamID == 0)
                {
                    return;
                }
                OperationReturn optReturn = XMLHelper.SeriallizeObject <StatisticParam>(SP);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("CreateConditionResultList Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                string StatisticC = optReturn.Data as string;
                ListTransParams.Add(StatisticC);

                for (int i = 0; i < mListABCDItems.Count; i++)
                {
                    StatisticalParamItemModel ItemModel = mListABCDItems[i];
                    ItemModel.abcdItem.CurrentApp = CurrentApp;
                    ItemModel.abcdItem.GetValue();
                    StatisticalParamItem SPI = ItemModel.abcdItem.ResultValues;
                    if (SPI.IsUsed == true && (SPI.Value == null || SPI.Value.Replace(" ", "") == string.Empty))
                    {
                        //勾选了,但是没有写值
                        CurrentApp.GetLanguageInfo("3108T003", "勾选了,但是没有写值");
                        return;
                    }
                    if (SPI.IsUsed == false)
                    {
                        continue;
                    }
                    optReturn = XMLHelper.SeriallizeObject <StatisticalParamItem>(SPI);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("CreateConditionResultList Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    StatisticC = optReturn.Data as string;
                    ListTransParams.Add(StatisticC);
                    //ListABCDItems更新
                    int index = ListABCDItems.FindIndex(p => p.StatisticalParamItemID == SPI.StatisticalParamItemID);
                    ListABCDItems[index] = SPI;
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Пример #2
0
        //获取参数大项里面的内容 也就是参数小项
        private void LoadParamContent()
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3108Codes.GetSelectParamItemsInfos;
                webRequest.Session = CurrentApp.Session;
                //先传入选择的参数大项的ID
                webRequest.ListData.Add(StatisticalParam.StatisticalParamID.ToString());

                Service31081Client client = new Service31081Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31081"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }

                mListParamItems.Clear();
                List <CombinedParamItemModel> templist = new List <CombinedParamItemModel>();
                mListStatisticalParamItem.Clear();
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    OperationReturn optReturn = XMLHelper.DeserializeObject <StatisticalParamItem>(webReturn.ListData[i]);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    StatisticalParamItem item = optReturn.Data as StatisticalParamItem;//注意看这里的类型
                    mListStatisticalParamItem.Add(item);
                    if (item == null)
                    {
                        ShowException(string.Format("Fail. CustomConditionItem is null"));
                        return;
                    }

                    CombinedParamItemModel itemItem = new CombinedParamItemModel(item, CurrentApp);//再看下这里的类型  看下这个是怎么实现的
                    templist.Add(itemItem);
                }
                var itemList = templist.OrderBy(temp => temp.SortID).ToList();
                for (int i = 0; i < itemList.Count; i++)
                {
                    mListParamItems.Add(itemList[i]);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
 private void LoadAddedCombinedParamItems()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3108Codes.GetAddedCombinedParamItems;
         webRequest.Session = CurrentApp.Session;
         //webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString());
         Service31081Client client = new Service31081Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31081"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail. WebReturn ListData is null"));
             return;
         }
         mListAddedParamsItems.Clear();
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <StatisticalParamItem>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             StatisticalParamItem item = optReturn.Data as StatisticalParamItem;
             if (item == null)
             {
                 ShowException(string.Format("Fail. StatisticalParamItem is null"));
                 return;
             }
             if (mListAllCombinedParamItem.Count(c => c.StatisticalParamItemID == item.StatisticalParamItemID.ToString()) > 0)
             {
                 CombinedParamItemModel itemItem = new CombinedParamItemModel(item, CurrentApp);
                 mListAddedParamsItems.Add(itemItem);
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Пример #4
0
 public CombinedParamItemModel(StatisticalParamItem paramItem, UMPApp currentApp)
 {
     ID = paramItem.StatisticalParamID;
     StatisticalParamItemID = paramItem.StatisticalParamItemID.ToString();
     Name        = paramItem.StatisticalParamItemName;
     Display     = paramItem.StatisticalParamItemName;
     TabIndex    = paramItem.TabIndex;
     TabName     = paramItem.TabName;
     SortID      = paramItem.SortID;
     Format      = paramItem.Formart;
     Type        = paramItem.Type;
     ParamItem   = paramItem;
     CurrentApp  = currentApp;
     IsAddedItem = false;
 }
Пример #5
0
 private void InitListABCDItem()
 {
     if (OperationCode.Length < 19)
     {
         return;
     }
     ListABCDItems.Clear();
     //mListABCDItems.Clear();
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3108Codes.GetABCDItemList;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(OperationCode);
         Service31081Client client = new Service31081Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31081"));
         WebHelper.SetServiceClient(client);
         //Service31081Client client = new Service31081Client();
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("InitListABCDItem Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <StatisticalParamItem>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("InitControledUsers Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             StatisticalParamItem StatisticP = optReturn.Data as StatisticalParamItem;
             StatisticP.StatisticalParamItemName = CurrentApp.GetLanguageInfo(string.Format("3108A{0}", StatisticP.StatisticalParamItemID), StatisticP.StatisticalParamItemName);
             StatisticP.Description = CurrentApp.GetLanguageInfo(string.Format("3108A{0}", StatisticP.StatisticalParamItemID), StatisticP.StatisticalParamItemName);
             ListABCDItems.Add(StatisticP);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Пример #6
0
 public StatisticalParamItemModel(StatisticalParamItem paramItem, UMPApp currentApp)
 {
     StatisticDuration        = paramItem.StatisticDuration;
     StatisticUnit            = paramItem.StatisticUnit;
     IsCombine                = paramItem.IsCombine;
     IsUsed                   = paramItem.IsUsed;
     Description              = paramItem.Description;
     StatisticalParamID       = paramItem.StatisticalParamID;
     StatisticalParamItemID   = paramItem.StatisticalParamItemID;
     StatisticalParamItemName = paramItem.StatisticalParamItemName;
     TabIndex                 = paramItem.TabIndex;
     TabName                  = paramItem.TabName;
     SortID                   = paramItem.SortID;
     Formart                  = paramItem.Formart;
     Type          = paramItem.Type;
     ConditionItem = paramItem;
     Value         = paramItem.Value;
     ValueType     = paramItem.ValueType;
     CurrentApp    = currentApp;
 }