private void LvRecordScoreDetail_SelectionChanged(object sender, SelectionChangedEventArgs e) { KpiInfoItem item = LvRecordScoreDetail.SelectedItem as KpiInfoItem; if (item != null) { mCurrentKpiInfoItem = item; LvRecordScoreDetail.SelectedItem = mCurrentKpiInfoItem; } }
//加载所有的KPI详细信息 private void LoadKpiDetailInfo() { try { WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S4601Codes.GetAllKPIInfoLists; webRequest.Session = CurrentApp.Session; Service46011Client client = new Service46011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service46011")); //Service46011Client client = new Service46011Client(); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } mListKpiInfoItems.Clear(); for (int i = 0; i < webReturn.ListData.Count; i++) { OperationReturn optReturn = XMLHelper.DeserializeObject <KpiInfo>(webReturn.ListData[i]); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } KpiInfo item = optReturn.Data as KpiInfo; if (item != null) { KpiInfoItem temp = new KpiInfoItem(item); temp.StrActive = CurrentApp.GetLanguageInfo(string.Format("4601IsActive{0}", temp.Active), temp.Active); temp.StrDescription = CurrentApp.GetLanguageInfo(string.Format("4601KPI{0}", temp.KpiInfo.KpiID), temp.Description); if (Regex.Matches(temp.UseType, @"1").Count > 0) { temp.StrUseType = string.Empty; if (temp.UseType.Substring(0, 1) == "1") { temp.StrUseType += CurrentApp.GetLanguageInfo(string.Format("4601BPOBJ{0}", "1000000000"), "1000000000") + ","; } if (temp.UseType.Substring(1, 1) == "1") { temp.StrUseType += CurrentApp.GetLanguageInfo(string.Format("4601BPOBJ{0}", "0100000000"), "0100000000") + ","; } if (temp.UseType.Substring(2, 1) == "1") { temp.StrUseType += CurrentApp.GetLanguageInfo(string.Format("4601BPOBJ{0}", "0010000000"), "0010000000") + ","; } if (temp.UseType.Substring(3, 1) == "1") { temp.StrUseType += CurrentApp.GetLanguageInfo(string.Format("4601BPOBJ{0}", "0001000000"), "0001000000") + ","; } if (temp.UseType.Substring(4, 1) == "1") { temp.StrUseType += CurrentApp.GetLanguageInfo(string.Format("4601BPOBJ{0}", "0000100000"), "0001000000") + ","; } if (temp.UseType.Substring(5, 1) == "1") { temp.StrUseType += CurrentApp.GetLanguageInfo(string.Format("4601BPOBJ{0}", "0000010000"), "0001000000") + " "; } } if (Regex.Matches(temp.ApplyCycle, @"1").Count > 0) { temp.StrApplyCycle = string.Empty; if (temp.ApplyCycle.Substring(0, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "1000000001"), "1000000001") + ","; } if (temp.ApplyCycle.Substring(1, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0100000001"), "0100000001") + ","; } if (temp.ApplyCycle.Substring(2, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0010000001"), "0010000001") + ","; } if (temp.ApplyCycle.Substring(3, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0001000001"), "0001000001") + ","; } if (temp.ApplyCycle.Substring(4, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0000100001"), "0000100001") + ","; } if (temp.ApplyCycle.Substring(5, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0000010001"), "0000010001") + ","; } if (temp.ApplyCycle.Substring(6, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0000001001"), "0000001001") + ","; } if (temp.ApplyCycle.Substring(7, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0000000101"), "0000000101") + ","; } if (temp.ApplyCycle.Substring(8, 1) == "1") { temp.StrApplyCycle += CurrentApp.GetLanguageInfo(string.Format("4601BP{0}", "0000000011"), "0000000011") + " "; } } mListKpiInfoItems.Add(temp); } } } catch (Exception ex) { ShowException(ex.Message); } }