private void InitVoiceIP_Name(ObjectItem parentItem, string parentID) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)WebCodes.GetVoiceIP_Name201; webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add("-1"); Service61012Client client = new Service61012Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress( CurrentApp.Session.AppServerInfo, "Service61012")); //Service61012Client client = new Service61012Client(); WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPReportOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); if (arrInfo.Length < 1) { continue; } //string strVoiceName = arrInfo[0]; string strVoiceIP = arrInfo[0]; ObjectItem item = new ObjectItem(); item.ObjType = ConstValue.RESOURCE_OPERATIONLOG_UMP; //item.Name = strVoiceName; item.FullName = strVoiceIP; item.Data = strInfo; item.DisplayContent = string.Format("({0})", strVoiceIP); item.Icon = "Images/computer.ico"; AddChildObject(parentItem, item); } } catch (Exception ex) { ShowException(ex.Message); } }
private void SaveQueryCondition() { if (this.CbSaveConditions.IsChecked == true) { //循环找出是否有重名的,有的话覆盖资料 string conditionName = this.ComboQueryConditions.Text; if (conditionName.Trim() == string.Empty) { CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("6101N0006", "Name cannot be Empty.")); return; } long queryCode = 0; List <string> ListSaveDatas = new List <string>(); QueryCondition SaveCondition = new QueryCondition(); bool Flag = false; for (int i = 0; i < mListQueryConditions.Count; i++) { if (mListQueryConditions[i].Name == conditionName) { SaveCondition.IsUse = mListQueryConditions[i].IsUse; SaveCondition.mName = mListQueryConditions[i].Name; SaveCondition.mDescription = mListQueryConditions[i].Description; SaveCondition.Priority = mListQueryConditions[i].Priority; SaveCondition.QueryCode = mListQueryConditions[i].QueryCode; SaveCondition.UserID = mListQueryConditions[i].UserID; SaveCondition.ReportCode = mListQueryConditions[i].ReportCode; SaveCondition.SetTime = mListQueryConditions[i].SetTime; SaveCondition.LastUseTime = mListQueryConditions[i].LastUseTime; SaveCondition.Source = mListQueryConditions[i].Source; Flag = true; break; } } if (!Flag)//没找到,要新建 { SaveCondition.QueryCode = 0; SaveCondition.UserID = CurrentApp.Session.UserID; SaveCondition.ReportCode = 61010021; SaveCondition.SetTime = DateTime.Now; SaveCondition.Source = 'S'; SaveCondition.LastUseTime = DateTime.Now; SaveCondition.mName = this.ComboQueryConditions.Text; SaveCondition.mDescription = this.ComboQueryConditions.Text; SaveCondition.Priority = mListQueryConditions.Count; SaveCondition.IsUse = true; } OperationReturn optReturn = XMLHelper.SeriallizeObject <QueryCondition>(SaveCondition); if (!optReturn.Result) { ShowException(CurrentApp.GetLanguageInfo("", "Save Fail!")); return; } ListSaveDatas.Add(optReturn.Data as string); queryCode = SaveCondition.QueryCode; //添加detail。 for (int i = 1; i <= 3; i++) { QueryConditionItem queryItem = new QueryConditionItem(); queryItem.QueryConditionCode = queryCode; queryItem.Sort = i; queryItem.Type = 0; switch (i) { case 1: //录音时间 queryItem.QueryItemCode = (long)Const6101.Query_RecordTime; queryItem.Value1 = this.UC_DateTime_Begin.Text; queryItem.Value2 = this.UC_DateTime_End.Text; queryItem.Value3 = this.CBXLoggedTime.SelectedIndex.ToString(); break; case 2: //呼叫方向 queryItem.QueryItemCode = (long)Const6101.Query_Call; if (this.RButn2.IsChecked == true) { queryItem.Value1 = "1"; } else if (this.RButn3.IsChecked == true) { queryItem.Value1 = "0"; } else { queryItem.Value1 = "2"; } break; case 3: //报表类型 queryItem.QueryItemCode = (long)Const6101.Query_ReportType; queryItem.Value1 = this.CBTypeOfReport.SelectedIndex.ToString(); break; } OperationReturn optReturnItem = XMLHelper.SeriallizeObject <QueryConditionItem>(queryItem); if (!optReturnItem.Result) { ShowException(CurrentApp.GetLanguageInfo("", "Save Fail!")); return; } ListSaveDatas.Add(optReturnItem.Data as string); } //调用函数方法保存 WebRequest webRequest = new WebRequest(); webRequest.Code = (int)WebCodes.SaveQueryCondition; webRequest.ListData = ListSaveDatas; webRequest.Session = CurrentApp.Session; Service61012Client client = new Service61012Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service61012")); WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPReportOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } S6101App.InitObjects(); InitQueryCondition(); } }
private void InitControlOrgs(ObjectItem parentItem, string parentID) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)WebCodes.GetControlOrgInfoList; webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add(parentID); Service61012Client client = new Service61012Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress( CurrentApp.Session.AppServerInfo, "Service61012")); WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPReportOperation(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.\tListData is null")); return; } List <ObjectItem> TempObjItems = new List <ObjectItem>(); for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); if (arrInfo.Length < 2) { continue; } string strID = arrInfo[0]; string strName = arrInfo[1]; ObjectItem item = new ObjectItem(); item.ObjType = ConstValue.RESOURCE_ORG; item.ObjID = Convert.ToInt64(strID); item.Name = strName; item.Data = strInfo; item.DisplayContent = string.Format("{0}", strName); if (strID == ConstValue.ORG_ROOT.ToString()) { item.Icon = "Images/rootorg.ico"; } else { item.Icon = "Images/org.ico"; } TempObjItems.Add(item); } TempObjItems.OrderBy(p => p.Name); foreach (ObjectItem item in TempObjItems) { InitControlOrgs(item, item.ObjID.ToString()); InitExtension(item, item.ObjID.ToString()); AddChildObject(parentItem, item); } } catch (Exception ex) { ShowException(ex.Message); } }