Esempio n. 1
0
        private void InitLBFirstItem()
        {
            StatisticParam SP = new StatisticParam();

            SP.StatisticalParamName = CurrentApp.GetLanguageInfo("310802001", "该机构所拥有的大项列表:");
            SP.StatisticalParamID   = 0;
            ListStatistical.Add(new StatisticParamModel(SP));
        }
Esempio n. 2
0
        public bool DeleteStatisticParamFromDB()
        {
            WebRequest webRequest = new WebRequest();

            webRequest.Code    = (int)S3108Codes.DeleteConfig;
            webRequest.Session = CurrentApp.Session;
            StatisticParam SP = new StatisticParam();

            SP.CycleTime            = DeleteStatisticParam.CycleTime;
            SP.StatisticKey         = DeleteStatisticParam.StatisticKey;
            SP.TableType            = DeleteStatisticParam.TableType;
            SP.RowNum               = DeleteStatisticParam.RowNum;
            SP.StatisticalParamID   = DeleteStatisticParam.StatisticalParamID;
            SP.StatisticalParamName = DeleteStatisticParam.StatisticalParamName;

            SP.CycleTimeParam = DeleteStatisticParam.CycleTimeParam;
            SP.IsCombine      = DeleteStatisticParam.IsCombine;
            SP.OrgID          = DeleteStatisticParam.OrgID;
            OperationReturn optReturn = XMLHelper.SeriallizeObject <StatisticParam>(SP);

            if (!optReturn.Result)
            {
                ShowException(string.Format("DeleteStatisticParamFromDB xml Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                return(false);
            }
            string StatisticC = optReturn.Data as string;

            webRequest.ListData.Add(StatisticC);
            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("deleteConfig Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                #region 记录日志
                string orgname = mListObjectItems.FirstOrDefault(p => p.ItemID == SP.OrgID.ToString()).Name;
                string msg     = string.Format("{0}{1}{2}:{3}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108007")), orgname, SP.StatisticalParamName);
                CurrentApp.WriteOperationLog("3108007", ConstValue.OPT_RESULT_FAIL, msg);
                #endregion
                return(false);
            }
            InitListBox();
            #region 记录日志
            string orgnameT = mListObjectItems.FirstOrDefault(p => p.ItemID == SP.OrgID.ToString()).Name;
            string msgT     = string.Format("{0}{1}{2}:{3}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108007")), orgnameT, SP.StatisticalParamName);
            CurrentApp.WriteOperationLog("3108007", ConstValue.OPT_RESULT_SUCCESS, msgT);
            #endregion
            return(true);
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
 private void InitListABCD()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3108Codes.GetABCDList;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add("1");
         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("InitListABCD Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <StatisticParam>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("InitListABCD Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             StatisticParam StatisticP = optReturn.Data as StatisticParam;
             string         Name       = StatisticP.StatisticalParamID.ToString();
             Name = Name.Substring(Name.Length - 1);
             StatisticP.StatisticalParamName = CurrentApp.GetLanguageInfo(string.Format("FO3108010200{0}", Name), StatisticP.StatisticalParamName);
             StatisticP.Description          = CurrentApp.GetLanguageInfo(string.Format("FO3108010200{0}", Name), StatisticP.StatisticalParamName);
             if (StatisticP != null)
             {
                 Statistic = new StatisticParamModel(StatisticP);
                 //ListABCD.Add(Statistic);
                 Dispatcher.Invoke(new Action(() => { ListABCD.Add(Statistic); }));
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 5
0
 public StatisticParamModel(StatisticParam SP)
 {
     StatisticalParamID   = SP.StatisticalParamID;
     StatisticalParamName = SP.StatisticalParamName;
     TableType            = SP.TableType;
     Description          = SP.Description;
     OrgID          = SP.OrgID;
     IsApplyAll     = SP.IsApplyAll;
     StatisticType  = SP.StatisticType;
     RowNum         = SP.RowNum;
     CycleTime      = SP.CycleTime;
     UpdateTime     = SP.UpdateTime;
     UpdateUnit     = SP.UpdateUnit;
     StatisticKey   = SP.StatisticKey;
     CycleTimeParam = SP.CycleTimeParam;
     IsUsed         = SP.IsUsed;
     IsCombine      = SP.IsCombine;
     StartTime      = Convert.ToDateTime(SP.StartTime);
     EndTime        = Convert.ToDateTime(SP.EndTime);
 }
Esempio n. 6
0
        //void LBStatistical_SelectionChanged(object sender, SelectionChangedEventArgs e)
        //{
        //    int num = this.LBStatistical.SelectedIndex;
        //    if (num == 0) { return; }
        //    StatisticalParam SP = this.LBStatistical.SelectedItem as StatisticalParam;
        //    OparetionCode = SP.StatisticalParamID.ToString();
        //}

        private void InitStatistical()
        {
            try
            {
                ListOrgStatistic.Clear();
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3108Codes.GetABCDList;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add("1");
                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("InitListABCD Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    OperationReturn optReturn = XMLHelper.DeserializeObject <StatisticParam>(webReturn.ListData[i]);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("InitListABCD Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    StatisticParam StatisticP = optReturn.Data as StatisticParam;
                    if (StatisticP != null)
                    {
                        ListOrgStatistic.Add(StatisticP);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Esempio n. 7
0
 public void InitListBox()
 {
     try
     {
         ListStatistical.Clear();
         if (ObjItem == null)
         {
             return;
         }
         InitLBFirstItem();
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3108Codes.GetABCDInfo;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(ObjItem.ItemID.ToString());
         //webRequest.ListData.Add(Statistic.StatisticKey.ToString());
         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("InitStatisticConfig Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         //if (webReturn.ListData.Count == 0)
         //{
         //    foreach (StatisticParam SP in ListOrgStatistic)
         //    {
         //        ListStatistical.Add(SP);
         //    }
         //}
         //else
         //{
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <StatisticParam>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("InitStatisticConfig Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             StatisticParam SP = optReturn.Data as StatisticParam;
             if (SP.StatisticalParamID == 3110000000000000008)
             {
                 SP.TableType = 2;
             }
             else
             {
                 SP.TableType = 1;
             }
             string spID = SP.StatisticalParamID.ToString();
             spID = spID.Substring(spID.Length - 1);
             SP.StatisticalParamName = CurrentApp.GetLanguageInfo(string.Format("FO3108010200{0}", spID), SP.StatisticalParamID.ToString());
             ListStatistical.Add(new StatisticParamModel(SP));
         }
     }
     //}
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 8
0
        private StatisticParam GetValueFromPage()
        {
            StatisticParam SP = new StatisticParam();

            if (!CheckValues())
            {
                //ShowInformation(CurrentApp.GetLanguageInfo("310802T001", "填入参数不全"));
                return(SP);
            }
            SP.StatisticalParamID   = Statistic.StatisticalParamID;
            SP.StatisticalParamName = Statistic.StatisticalParamName;
            SP.TableType            = Statistic.TableType;
            SP.Description          = Statistic.Description;
            SP.RowNum       = Statistic.RowNum;
            SP.CycleTime    = Statistic.CycleTime;
            SP.StatisticKey = Statistic.StatisticKey;
            SP.IsUsed       = Statistic.IsUsed;
            SP.IsCombine    = Statistic.IsCombine;
            SP.OrgID        = Convert.ToInt64(OrgItem.ItemID);
            //SP.StartTime = Convert.ToDateTime(this.ST.Text).ToUniversalTime();
            //SP.EndTime = Convert.ToDateTime(this.ET.Text).ToUniversalTime();
            SP.StartTime  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            SP.EndTime    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            SP.UpdateTime = Convert.ToInt32(this.UpdateTime.Text);
            SP.UpdateUnit = (this.UpdateUnit.SelectedIndex + 1);
            if (this.DrillWay.IsChecked == true)
            {
                SP.StatisticType = 2;
            }
            else
            {
                SP.StatisticType = 1;
            }
            if (this.StartCheck.IsChecked == true)
            {
                SP.IsApplyAll = 1;
            }
            else
            {
                SP.IsApplyAll = 2;
            }
            string temp   = string.Empty;
            string daynum = string.Empty;

            switch (this.CycleUnit.SelectedIndex)
            {
            case 0:
                temp = "D";
                break;

            case 1:
                temp   = "W";
                daynum = (this.CycleDay.SelectedIndex + 1).ToString();
                break;

            case 2:
                temp   = "M";
                daynum = (this.CycleDay.SelectedIndex + 1).ToString();
                if (int.Parse(daynum) > 28)
                {
                    daynum = (int.Parse(daynum) - 32).ToString();
                }
                break;

            case 3:
                temp   = "Y";
                daynum = (this.CycleDay.SelectedIndex + 1).ToString();
                break;

            default:
                break;
            }
            SP.CycleTimeParam.Add(temp);
            SP.CycleTimeParam.Add(this.CycleTime.Text);
            //SP.CycleTimeParam.Add(Convert.ToDateTime(this.Time.Text).ToUniversalTime().ToString());
            SP.CycleTimeParam.Add(daynum);

            return(SP);
        }
Esempio n. 9
0
 private void InitStatisticConfig()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3108Codes.GetABCDInfo;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(OrgItem.ItemID.ToString());
         //webRequest.ListData.Add(Statistic.StatisticKey.ToString());
         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("InitStatisticConfig Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <StatisticParam>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("InitStatisticConfig Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             StatisticParam SP = optReturn.Data as StatisticParam;
             int            index;
             for (index = 0; index < ListABCD.Count(); index++)
             {
                 if (ListABCD[index].StatisticalParamID == SP.StatisticalParamID)
                 {
                     ListABCD[index].StatisticKey   = SP.StatisticKey;
                     ListABCD[index].OrgID          = SP.OrgID;
                     ListABCD[index].StatisticType  = SP.StatisticType;
                     ListABCD[index].IsApplyAll     = SP.IsApplyAll;
                     ListABCD[index].StartTime      = Convert.ToDateTime(SP.StartTime);
                     ListABCD[index].EndTime        = Convert.ToDateTime(SP.EndTime);
                     ListABCD[index].RowNum         = SP.RowNum;
                     ListABCD[index].CycleTime      = SP.CycleTime;
                     ListABCD[index].CycleTimeParam = SP.CycleTimeParam;
                     ListABCD[index].UpdateTime     = SP.UpdateTime;
                     ListABCD[index].UpdateUnit     = SP.UpdateUnit;
                     break;
                 }
             }
             //Statistic.StatisticKey = SP.StatisticKey;
             //Statistic.OrgID = SP.OrgID;
             //Statistic.StatisticType = SP.StatisticType;
             //Statistic.IsApplyAll = SP.IsApplyAll;
             //Statistic.StartTime = SP.StartTime;
             //Statistic.EndTime = SP.EndTime;
             //Statistic.RowNum = SP.RowNum;
             //Statistic.CycleTime = SP.CycleTime;
             //Statistic.CycleTimeParam = SP.CycleTimeParam;
             //Statistic.UpdateTime = SP.UpdateTime;
             //Statistic.UpdateUnit = SP.UpdateUnit;
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }