private void InitFontWeightValueItems()
 {
     try
     {
         var fontWeights = GetFontWeights();
         int count       = 0;
         var listTemp    = new List <PropertyValueEnumItem>();
         foreach (var fontWeight in fontWeights)
         {
             PropertyValueEnumItem item = new PropertyValueEnumItem();
             item.Display = fontWeight.ToString();
             item.Display = fontWeight.ToString();
             item.SortID  = count;
             item.Info    = fontWeight;
             count++;
             listTemp.Add(item);
         }
         listTemp = listTemp.OrderBy(f => f.Display).ToList();
         for (int i = 0; i < listTemp.Count; i++)
         {
             mListEnumValueItems.Add(listTemp[i]);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
 void ComboServiceNames_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         var item = ComboServiceNames.SelectedItem as PropertyValueEnumItem;
         if (item == null)
         {
             string strName = ComboServiceNames.Text;
             if (string.IsNullOrEmpty(strName))
             {
                 return;
             }
             CTIServiceNameInfo info = new CTIServiceNameInfo();
             info.Name        = strName;
             item             = new PropertyValueEnumItem();
             item.Value       = info.Name;
             item.Display     = info.Name;
             item.Description = info.Name;
             item.Info        = info;
             //mListCTIServiceNameItems.Add(item);
         }
         if (mPropertyValue != null)
         {
             mPropertyValue.Value = item.Value;
         }
         OnPropertyValueChanged();
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 3
0
        public override void ChangeLanguage()
        {
            this.LabChanIP.Content      = CurrentApp.GetLanguageInfo("1110WIZ07002", "通道IP:");
            this.LabChanName.Content    = CurrentApp.GetLanguageInfo("1110WIZ07003", "通道名称:");
            this.LabStartupMode.Content = CurrentApp.GetLanguageInfo("1110WIZ07004", "启动方式:");

            this.ButnBack.Content     = CurrentApp.GetLanguageInfo("1110WIZB0003", "返回");
            this.ButnPrevious.Content = CurrentApp.GetLanguageInfo("1110WIZB0002", "上一页");
            this.ButnNext.Content     = CurrentApp.GetLanguageInfo("1110WIZB0001", "下一页");
            this.ButnAdd.Content      = CurrentApp.GetLanguageInfo("1110WIZB0004", "Add");
            this.ButnBatch.Content    = CurrentApp.GetLanguageInfo("1110WIZB0005", "Batch");
            MainPage.PopupPanel.Title = CurrentApp.GetLanguageInfo("1110WIZ07001", "录音通道");

            for (int i = 0; i < ListStartupItems.Count; i++)
            {
                PropertyValueEnumItem item          = ListStartupItems[i];
                BasicInfoData         basicInfoData = item.Info as BasicInfoData;
                if (basicInfoData != null)
                {
                    item.Display =
                        CurrentApp.GetLanguageInfo(
                            string.Format("BID{0}{1}", basicInfoData.InfoID, basicInfoData.SortID.ToString("000")),
                            basicInfoData.Icon);
                }
            }
        }
 private void InitEnumValueItems()
 {
     try
     {
         if (mScoreObject == null ||
             mScoreProperty == null)
         {
             return;
         }
         var      type  = mScoreProperty.ValueType;
         string[] enums = Enum.GetNames(type);
         for (int i = 0; i < enums.Length; i++)
         {
             var    strName    = enums[i];
             var    temp       = Enum.Parse(type, strName);
             string strDisplay =
                 CurrentApp.GetLanguageInfo(string.Format("3101ENUM{0}{1}", type.Name, ((int)temp).ToString("000")),
                                            temp.ToString());
             PropertyValueEnumItem item = new PropertyValueEnumItem();
             item.Display     = strDisplay;
             item.Description = strDisplay;
             item.SortID      = i;
             item.Info        = temp;
             mListEnumValueItems.Add(item);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
 private void Init()
 {
     try
     {
         if (PropertyInfoItem == null)
         {
             return;
         }
         CurrentApp = PropertyInfoItem.CurrentApp;
         ConfigObject configObject = PropertyInfoItem.ConfigObject;
         if (configObject != null)
         {
             mConfigObject = configObject;
         }
         ObjectPropertyInfo propertyInfo = PropertyInfoItem.PropertyInfo;
         if (propertyInfo != null)
         {
             mPropertyInfo = propertyInfo;
         }
         ResourceProperty propertyValue = PropertyInfoItem.ResourceProperty;
         if (propertyValue != null)
         {
             mPropertyValue = propertyValue;
         }
         if (mPropertyValue == null)
         {
             return;
         }
         if (!string.IsNullOrEmpty(mPropertyValue.Value))
         {
             string cardID   = mPropertyValue.Value;
             string cardName = cardID;
             if (mPropertyValue.ListOtherValues != null && mPropertyValue.ListOtherValues.Count > 0)
             {
                 cardName = mPropertyValue.ListOtherValues[0];
             }
             NetworkCardInfo info = new NetworkCardInfo();
             info.ID          = cardID;
             info.Name        = cardName;
             info.Description = string.Format("{0}({1})", cardName, cardID);
             PropertyValueEnumItem item = new PropertyValueEnumItem();
             item.Value       = info.ID;
             item.Display     = info.Name;
             item.Description = info.Description;
             item.Info        = info;
             var temp = mListNetworkCardItems.FirstOrDefault(c => c.Value == cardID);
             if (temp == null)
             {
                 temp = item;
                 mListNetworkCardItems.Add(temp);
             }
             ComboNetworkCards.SelectedItem = temp;
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 6
0
        private void SaveRecordChannel()
        {
            if (this.IPTextBox.GetIP() != string.Empty && this.IPTextBox.GetIP() != "0.0.0.0")
            {
                ResourceProperty TempResourceProper = CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 13);
                if (TempResourceProper != null)
                {
                    CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 13).Value = this.IPTextBox.GetIP();
                }
            }

            if (this.TexChanName.Text != string.Empty)
            {
                ResourceProperty TempResourceProper = CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 12);
                if (TempResourceProper != null)
                {
                    CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 12).Value = this.TexChanName.Text;
                }
            }

            if (this.CombStartupMode.SelectedIndex != -1)
            {
                ResourceProperty TempResourceProper = CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 21);
                if (TempResourceProper != null)
                {
                    PropertyValueEnumItem propertyItem = this.CombStartupMode.SelectedItem as PropertyValueEnumItem;
                    CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 21).Value = propertyItem.Value;
                }
            }

            CurrentConfigObj.GetBasicPropertyValues();
            bool IsFind = false;

            //List<ConfigObject> TempList = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 225 && p.ParentID == RecordConfigObj.ObjectID).ToList();
            for (int i = 0; i < ListReadyExistChans.Count; i++)
            {
                if (ListReadyExistChans[i].ObjectID == CurrentConfigObj.ObjectID)
                {
                    IsFind = true;
                }
            }
            if (!IsFind)
            {
                WizardHelper.ListAllConfigObjects.Add(CurrentConfigObj);
                //WizardHelper.ListRecords.Add(CurrentConfigObj);
                ListRecordChannels.Add(CurrentConfigObj);
            }
            if (RecordChannelNumber > ListRecordChannels.Count)
            {
                ListRecordChannels.Add(CurrentConfigObj);
            }
            if (ParentObjectItem != null)
            {
                MainPage.CreateNewChannelConfigObjectItem(ParentObjectItem, CurrentConfigObj);
                //MainPage.RefreshConfigObjectItem(ParentObjectItem);
            }
        }
 private void Init()
 {
     try
     {
         if (PropertyInfoItem == null)
         {
             return;
         }
         CurrentApp = PropertyInfoItem.CurrentApp;
         ConfigObject configObject = PropertyInfoItem.ConfigObject;
         if (configObject != null)
         {
             mConfigObject = configObject;
         }
         ObjectPropertyInfo propertyInfo = PropertyInfoItem.PropertyInfo;
         if (propertyInfo != null)
         {
             mPropertyInfo = propertyInfo;
         }
         ResourceProperty propertyValue = PropertyInfoItem.ResourceProperty;
         if (propertyValue != null)
         {
             mPropertyValue = propertyValue;
         }
         if (mPropertyValue == null)
         {
             return;
         }
         if (!string.IsNullOrEmpty(mPropertyValue.Value))
         {
             mListCTIServiceNameItems.Clear();
             CTIServiceNameInfo info = new CTIServiceNameInfo();
             info.Name = mPropertyValue.Value;
             PropertyValueEnumItem item = new PropertyValueEnumItem();
             item.Value       = info.Name;
             item.Display     = info.Name;
             item.Description = info.Name;
             item.Info        = info;
             mListCTIServiceNameItems.Add(item);
             for (int i = 0; i < ComboServiceNames.Items.Count; i++)
             {
                 var temp = ComboServiceNames.Items[i] as PropertyValueEnumItem;
                 if (temp != null)
                 {
                     if (temp.Value == item.Value)
                     {
                         ComboServiceNames.SelectedItem = temp;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
        private void InitYesNoEnumItems()
        {
            PropertyValueEnumItem item = new PropertyValueEnumItem();

            item.Value      = "1";
            item.Display    = CurrentApp.GetLanguageInfo(string.Format("COM004"), "Yes");
            item.IsSelected = true;
            item.Info       = "COM004";
            mListPropertyValueEnumItems.Add(item);
            item            = new PropertyValueEnumItem();
            item.Value      = "0";
            item.Info       = "COM005";
            item.Display    = CurrentApp.GetLanguageInfo(string.Format("COM005"), "No");
            item.IsSelected = false;
            mListPropertyValueEnumItems.Add(item);
        }
Esempio n. 9
0
        private void InitCTIType()
        {
            //加载CTI类型下拉对象
            List <BasicInfoData> TempBasicInfo = WizardHelper.ListAllBasicInfos.Where(p => p.InfoID == 111000300).ToList();

            mListCTITypeItems.Clear();
            foreach (BasicInfoData info in TempBasicInfo)
            {
                PropertyValueEnumItem propertyValueItem = new PropertyValueEnumItem();
                propertyValueItem.Value   = info.Value;
                propertyValueItem.Display =
                    CurrentApp.GetLanguageInfo(string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                                               info.Icon);
                propertyValueItem.Info = info;
                mListCTITypeItems.Add(propertyValueItem);
            }
        }
 private void InitScoreItemValueItems()
 {
     try
     {
         if (mScoreObject == null ||
             mScoreProperty == null)
         {
             return;
         }
         switch (mScoreProperty.ID)
         {
         case ScoreProperty.PRO_CTL_SOURCE:
         case ScoreProperty.PRO_CTL_TARGET:
             var ctlItem = mScoreObject as ControlItem;
             if (ctlItem != null)
             {
                 var scoreSheet = ctlItem.ScoreSheet;
                 if (scoreSheet != null)
                 {
                     List <ScoreItem> listItems = new List <ScoreItem>();
                     scoreSheet.GetAllScoreItem(ref listItems);
                     if (mScoreProperty.ID == ScoreProperty.PRO_CTL_TARGET)
                     {
                         listItems.Add(scoreSheet);
                     }
                     for (int i = 0; i < listItems.Count; i++)
                     {
                         var scoreItem = listItems[i];
                         PropertyValueEnumItem item = new PropertyValueEnumItem();
                         item.Display     = scoreItem.Title;
                         item.Description = scoreItem.Description;
                         item.SortID      = i;
                         item.Info        = scoreItem;
                         mListEnumValueItems.Add(item);
                     }
                 }
             }
             break;
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 11
0
        private void InitEditionItems()
        {
            List <BasicInfoData> TempBasicInfo = WizardHelper.ListAllBasicInfos.Where(p => p.InfoID == 111000303).ToList();

            mListEditionItems.Clear();
            foreach (BasicInfoData info in TempBasicInfo)
            {
                PropertyValueEnumItem propertyValueItem = new PropertyValueEnumItem();
                propertyValueItem.Value   = info.Value;
                propertyValueItem.Display =
                    CurrentApp.GetLanguageInfo(string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                                               info.Icon);
                propertyValueItem.Info = info;
                mListEditionItems.Add(propertyValueItem);
            }
            //创建一个configobject241
            ConfigObject TempConfig = mListCtiConfigObjs.FirstOrDefault(p => p.ObjectID.ToString().Length > 3 && p.ObjectID.ToString().Substring(0, 3) == "242");

            if (TempConfig != null)
            {
                CurrenPageCTIConfigObj = WizardHelper.CreateNewConfigObject(TempConfig, 241);
                this.IPTextBox.SetIP(CurrenPageCTIConfigObj.ListProperties.Find(p => p.PropertyID == 11).Value);
                this.IPTexPBX.SetIP(CurrenPageCTIConfigObj.ListProperties.Find(p => p.PropertyID == 13).Value);
                this.TexPort.Text       = CurrenPageCTIConfigObj.ListProperties.Find(p => p.PropertyID == 12).Value;
                this.TexAgreenment.Text = CurrenPageCTIConfigObj.ListProperties.Find(p => p.PropertyID == 19).Value;
                if (CurrenPageCTIConfigObj.ListProperties.Find(p => p.PropertyID == 16).Value == "1")
                {
                    this.RadBDMCCYes.IsChecked = true;
                }
                else
                {
                    this.RadBDMCCNo.IsChecked = true;
                }
                if (CurrenPageCTIConfigObj.ListProperties.Find(p => p.PropertyID == 17).Value == "1")
                {
                    this.RadBSSLYes.IsChecked = true;
                }
                else
                {
                    this.RadBSSLNo.IsChecked = true;
                }
            }
        }
Esempio n. 12
0
        private void SaveRecordAgreement()
        {
            if (this.TexPBX.Text != string.Empty)
            {
                ResourceProperty TempResourceProper = CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 22);
                if (TempResourceProper != null)
                {
                    TempResourceProper.Value = this.TexPBX.Text;
                }
            }
            if (this.CombVoip.SelectedIndex != -1)
            {
                ResourceProperty TempResourceProper = CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 11);
                if (TempResourceProper != null)
                {
                    PropertyValueEnumItem propertyItem = this.CombVoip.SelectedItem as PropertyValueEnumItem;
                    TempResourceProper.Value = propertyItem.Value;
                }
            }
            CurrentConfigObj.GetBasicPropertyValues();
            bool IsFind = false;
            List <ConfigObject> TempList = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 223 && p.ParentID == RecordConfigObj.ObjectID).ToList();

            for (int i = 0; i < TempList.Count; i++)
            {
                if (TempList[i].ObjectID == CurrentConfigObj.ObjectID)
                {
                    IsFind = true;
                }
            }
            if (!IsFind)
            {
                WizardHelper.ListAllConfigObjects.Add(CurrentConfigObj);
            }
            if (RecordAgreementNumber > ListAgreements.Count)
            {
                ListAgreements.Add(CurrentConfigObj);
            }
            if (ParentObjectItem != null)
            {
                MainPage.RefreshConfigObjectItem(ParentObjectItem);
            }
        }
        private void InitBasicInfoEnumItems()
        {
            try
            {
                if (mWidgetItem == null)
                {
                    return;
                }
                var listAllBasicInfos = mWidgetItem.ListBasicDataInfos;
                if (listAllBasicInfos == null)
                {
                    return;
                }
                if (mWidgetPropertyInfo == null)
                {
                    return;
                }
                long sourceID       = mWidgetPropertyInfo.SourceID;
                var  listBasicInfos = listAllBasicInfos.Where(b => b.InfoID == sourceID).OrderBy(b => b.SortID).ToList();
                for (int i = 0; i < listBasicInfos.Count; i++)
                {
                    var info = listBasicInfos[i];

                    PropertyValueEnumItem item = new PropertyValueEnumItem();
                    item.Display =
                        CurrentApp.GetLanguageInfo(
                            string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                            info.Icon);
                    item.Description = CurrentApp.GetLanguageInfo(
                        string.Format("BIDD{0}{1}", info.InfoID, info.SortID.ToString("000")),
                        info.Icon);
                    item.SortID = info.SortID;
                    item.Value  = info.Value;
                    item.Info   = info;
                    mListPropertyValueEnumItems.Add(item);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Esempio n. 14
0
 private void InitCTITypeItems()
 {
     try
     {
         if (ListConfigObjects != null)
         {
             var objs =
                 ListConfigObjects.Where(o => o.ObjectType == S1110Consts.RESOURCE_CTICONNECTIONGROUPCOLLECTION)
                 .ToList();
             for (int i = 0; i < objs.Count; i++)
             {
                 ConfigObject     obj           = objs[i];
                 ResourceProperty propertyValue = obj.ListProperties.FirstOrDefault(p => p.PropertyID == 11);
                 if (propertyValue != null)
                 {
                     string ctiType             = propertyValue.Value;
                     PropertyValueEnumItem item = new PropertyValueEnumItem();
                     item.Value       = ctiType;
                     item.Display     = obj.Name;
                     item.Description = obj.Name;
                     item.Info        = obj;
                     if (ListAllCTITypeInfos != null)
                     {
                         var basicInfo =
                             ListAllCTITypeInfos.FirstOrDefault(
                                 b => b.InfoID == 111000300 && b.Value == ctiType);
                         if (basicInfo != null)
                         {
                             item.Display = basicInfo.Icon;
                         }
                     }
                     mListCTITypeItems.Add(item);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 15
0
        public override void ChangeLanguage()
        {
            this.LabLicenseNumber.Content = CurrentApp.GetLanguageInfo("1110WIZ06003", "License数量:");
            this.LabNumber.Content = CurrentApp.GetLanguageInfo("1110WIZ06002", "Number:");

            this.ButnBack.Content = CurrentApp.GetLanguageInfo("1110WIZB0003", "返回");
            this.ButnPrevious.Content = CurrentApp.GetLanguageInfo("1110WIZB0002", "上一页");
            this.ButnNext.Content = CurrentApp.GetLanguageInfo("1110WIZB0001", "下一页");
            MainPage.PopupPanel.Title = CurrentApp.GetLanguageInfo("1110WIZ06001", "配置向导");

            for (int i = 0; i < ListConcurrencyItems.Count; i++)
            {
                PropertyValueEnumItem item = ListConcurrencyItems[i];
                BasicInfoData basicInfoData = item.Info as BasicInfoData;
                if (basicInfoData != null)
                {
                    item.Display =
                        CurrentApp.GetLanguageInfo(
                            string.Format("BID{0}{1}", basicInfoData.InfoID, basicInfoData.SortID.ToString("000")),
                            basicInfoData.Icon);
                }
            }
        }
Esempio n. 16
0
        public override void ChangeLanguage()
        {
            this.ButnAdd.Content      = CurrentApp.GetLanguageInfo("1110WIZB0004", "添加");
            this.ButnBack.Content     = CurrentApp.GetLanguageInfo("1110WIZB0003", "返回");
            this.ButnPrevious.Content = CurrentApp.GetLanguageInfo("1110WIZB0002", "上一页");
            this.ButnNext.Content     = CurrentApp.GetLanguageInfo("1110WIZB0001", "下一页");
            MainPage.PopupPanel.Title = CurrentApp.GetLanguageInfo("1110WIZ04001", "网卡:IP");

            this.LabCapture.Content     = CurrentApp.GetLanguageInfo("1110WIZ04002", "抓包模式:");
            this.LabNetworkName.Content = CurrentApp.GetLanguageInfo("1110WIZ04003", "网卡名称:");

            for (int i = 0; i < ListCaptureItems.Count; i++)
            {
                PropertyValueEnumItem item          = ListCaptureItems[i];
                BasicInfoData         basicInfoData = item.Info as BasicInfoData;
                if (basicInfoData != null)
                {
                    item.Display =
                        CurrentApp.GetLanguageInfo(
                            string.Format("BID{0}{1}", basicInfoData.InfoID, basicInfoData.SortID.ToString("000")),
                            basicInfoData.Icon);
                }
            }
        }
Esempio n. 17
0
 private void LoadCTIServiceNames()
 {
     try
     {
         if (PropertyInfoItem == null || PropertyInfoItem.ListConfigObjects == null)
         {
             return;
         }
         if (mConfigObject == null)
         {
             return;
         }
         var parentObj =
             PropertyInfoItem.ListConfigObjects.FirstOrDefault(
                 o => o.ObjectID == mConfigObject.ParentID);
         if (parentObj == null)
         {
             return;
         }
         //Property 11 is CTI Type
         ResourceProperty propertyValue = parentObj.ListProperties.FirstOrDefault(p => p.PropertyID == 11);
         if (propertyValue == null)
         {
             return;
         }
         //AES, CVCT 才有效
         if (propertyValue.Value != "4" && propertyValue.Value != "5")
         {
             return;
         }
         string strAddress    = GetService00Address();
         string strPBXAddress = GetPBXAddress();
         if (string.IsNullOrEmpty(strAddress) ||
             string.IsNullOrEmpty(strPBXAddress))
         {
             ShowException(string.Format("Server address or PBX address is empty"));
             return;
         }
         ServerRequestInfo requestInfo = new ServerRequestInfo();
         requestInfo.ServerHost = strAddress;
         requestInfo.ServerPort = 8009;
         requestInfo.Command    = (int)ServerRequestCommand.GetCTIServiceName;
         requestInfo.ListData.Add(strPBXAddress);
         OperationReturn optReturn = XMLHelper.SeriallizeObject(requestInfo);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S1110Codes.GetServerInfo;
         webRequest.Data    = optReturn.Data.ToString();
         Service11102Client client = new Service11102Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service11102"));
         WebReturn webReturn = null;
         if (MainPage != null)
         {
             MainPage.SetBusy(true, CurrentApp.GetMessageLanguageInfo("011", "Getting PBX serviceName..."));
         }
         mWorker         = new BackgroundWorker();
         mWorker.DoWork += (s, de) =>
         {
             try
             {
                 webReturn = client.DoOperation(webRequest);
                 client.Close();
             }
             catch (Exception ex)
             {
                 ShowException(ex.Message);
             }
         };
         mWorker.RunWorkerCompleted += (s, re) =>
         {
             mWorker.Dispose();
             if (MainPage != null)
             {
                 MainPage.SetBusy(false, string.Empty);
             }
             if (webReturn == null)
             {
                 return;
             }
             if (!webReturn.Result)
             {
                 ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                 return;
             }
             if (webReturn.ListData == null)
             {
                 ShowException(string.Format("ListData is null"));
                 return;
             }
             for (int i = 0; i < webReturn.ListData.Count; i++)
             {
                 string             name = webReturn.ListData[i];
                 CTIServiceNameInfo info = new CTIServiceNameInfo();
                 info.Name = name;
                 var temp = mListCTIServiceNameItems.FirstOrDefault(t => t.Value == info.Name);
                 if (temp == null)
                 {
                     temp             = new PropertyValueEnumItem();
                     temp.Value       = info.Name;
                     temp.Display     = info.Name;
                     temp.Description = info.Name;
                     temp.Info        = info;
                     mListCTIServiceNameItems.Add(temp);
                 }
             }
         };
         mWorker.RunWorkerAsync();
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 18
0
        private void LoadNetworkCardInfos(List <string> listHostAddresses)
        {
            List <NetworkCardInfo> listCardInfo = new List <NetworkCardInfo>();
            WebRequest             webRequest   = new WebRequest();

            webRequest.Session = CurrentApp.Session;
            webRequest.Code    = (int)S1110Codes.GetServerInfo;
            Service11102Client client = new Service11102Client(
                WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                WebHelper.CreateEndpointAddress(
                    CurrentApp.Session.AppServerInfo,
                    "Service11102"));
            bool   isFail = true;
            string strMsg = string.Empty;

            if (MainPage != null)
            {
                MainPage.SetBusy(true, CurrentApp.GetMessageLanguageInfo("005", "Getting server networkcard information"));
            }
            BackgroundWorker worker = new BackgroundWorker();

            worker.DoWork += (s, de) =>
            {
                try
                {
                    for (int i = 0; i < listHostAddresses.Count; i++)
                    {
                        string address = listHostAddresses[i];
                        if (string.IsNullOrEmpty(address))
                        {
                            strMsg += string.Format("Server address is empty!;");
                            continue;
                        }
                        ServerRequestInfo requestInfo = new ServerRequestInfo();
                        requestInfo.ServerHost = address;
                        requestInfo.ServerPort = 8009;
                        requestInfo.Command    = (int)ServerRequestCommand.GetNetworkCardList;
                        OperationReturn optReturn = XMLHelper.SeriallizeObject(requestInfo);
                        if (!optReturn.Result)
                        {
                            strMsg += string.Format("Fail.\t{0}\t{1}\t{2};", address, optReturn.Code, optReturn.Message);
                            continue;
                        }
                        webRequest.Data = optReturn.Data.ToString();
                        WebReturn webReturn = client.DoOperation(webRequest);
                        if (!webReturn.Result)
                        {
                            strMsg += string.Format("WSFail.\t{0}\t{1}\t{2};", address, webReturn.Code, webReturn.Message);
                            continue;
                        }
                        if (webReturn.ListData == null)
                        {
                            strMsg += string.Format("ListData is null;");
                            continue;
                        }
                        for (int j = 0; j < webReturn.ListData.Count; j++)
                        {
                            string   info    = webReturn.ListData[j];
                            string[] arrInfo = info.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries);
                            if (arrInfo.Length < 2)
                            {
                                continue;
                            }
                            NetworkCardInfo card = new NetworkCardInfo();
                            card.ID          = arrInfo[1];
                            card.Name        = string.Format("{0}[{1}]", arrInfo[0], address);
                            card.Description = string.Format("{0}[{1}]({2})", arrInfo[0], address, arrInfo[1]);
                            listCardInfo.Add(card);
                        }
                    }
                    isFail = false;
                }
                catch (Exception ex)
                {
                    isFail = true;
                    strMsg = ex.Message;
                }
            };
            worker.RunWorkerCompleted += (s, re) =>
            {
                worker.Dispose();

                if (MainPage != null)
                {
                    MainPage.SetBusy(false, string.Empty);
                }

                try
                {
                    if (isFail)
                    {
                        ShowException(strMsg);
                        return;
                    }
                    if (!string.IsNullOrEmpty(strMsg))
                    {
                        ShowException(strMsg);
                    }
                    for (int i = 0; i < listCardInfo.Count; i++)
                    {
                        var card = listCardInfo[i];
                        PropertyValueEnumItem item = new PropertyValueEnumItem();
                        item.Value       = card.ID;
                        item.Display     = card.Name;
                        item.Description = card.Description;
                        item.Info        = card;
                        var temp = mListNetworkCardItems.FirstOrDefault(e => e.Value == item.Value);
                        if (temp == null)
                        {
                            mListNetworkCardItems.Add(item);
                        }
                        else
                        {
                            temp.Display     = item.Display;
                            temp.Description = item.Description;
                            temp.Info        = item.Info;
                        }
                    }
                }
                catch (Exception ex)
                {
                    ShowException(ex.Message);
                }
            };
            worker.RunWorkerAsync();
        }
Esempio n. 19
0
        private void InitControlObject()
        {
            ListRecordNetwork = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 222 && p.ParentID == RecordConfigObj.ObjectID).ToList();
            int ListCount = ListRecordNetwork.Count;
            List <BasicInfoData> TempBasicInfo = WizardHelper.ListAllBasicInfos.Where(p => p.InfoID == 111000200).ToList();

            foreach (BasicInfoData info in TempBasicInfo)
            {
                PropertyValueEnumItem propertyValueItem = new PropertyValueEnumItem();
                propertyValueItem.IsCheckedChanged += EnumItem_IsCheckedChanged;
                propertyValueItem.Value             = info.Value;
                propertyValueItem.Display           =
                    CurrentApp.GetLanguageInfo(string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                                               info.Icon);
                propertyValueItem.Info = info;
                ListCaptureItems.Add(propertyValueItem);
            }
            if (ListCount >= RecordNetWorkNumber)
            {
                //加载显示已有项
                NetworkConfigObj = ListRecordNetwork[RecordNetWorkNumber - 1];
                ResourceProperty NetworkName = NetworkConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 12);
                if (NetworkName != null)
                {
                    this.CombNetworkName.Text = NetworkName.Value;
                }
                ResourceProperty mPropertyValue = NetworkConfigObj.ListProperties.Find(p => p.PropertyID == 11);
                if (mPropertyValue != null)
                {
                    int value = 0;
                    if (int.TryParse(mPropertyValue.Value, out value))
                    {
                        if ((value & 1) == 1)
                        {
                            PropertyValueEnumItem propertyItem = ListCaptureItems.FirstOrDefault(p => p.Value == "1");
                            if (propertyItem != null)
                            {
                                propertyItem.IsChecked = true;
                            }
                            else
                            {
                                propertyItem.IsChecked = false;
                            }
                        }
                        if ((value & 2) == 2)
                        {
                            PropertyValueEnumItem propertyItem = ListCaptureItems.FirstOrDefault(p => p.Value == "2");
                            if (propertyItem != null)
                            {
                                propertyItem.IsChecked = true;
                            }
                            else
                            {
                                propertyItem.IsChecked = false;
                            }
                        }
                    }
                }
            }
            else
            {
                List <ObjectItem> tempObjItem = WizardHelper.ListAllObjectItem.Where(p => p.Type == 1).ToList();
                int ReadyNumber = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 222 && p.ParentID == RecordConfigObj.ObjectID).ToList().Count();
                for (int i = 0; i < tempObjItem.Count; i++)
                {
                    ConfigGroup tempCG = tempObjItem[i].Data as ConfigGroup;
                    if (tempCG.GroupID == 26 && tempCG.ChildType == 222 && tempCG.ConfigObject == RecordConfigObj)
                    {
                        int MinValue = tempCG.GroupInfo.IntValue01; int MaxValue = tempCG.GroupInfo.IntValue02;
                        if ((ReadyNumber + 1) > MaxValue || (ReadyNumber + 1) < MinValue)
                        {
                            return;
                        }
                        //WizardHelper.ListAllConfigObjects.Add(WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 222));
                        NetworkConfigObj = WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 222);
                        NetworkConfigObj.ListProperties.Find(p => p.PropertyID == 3).Value = RecordConfigObj.ObjectID.ToString();
                        ParentObjectItem = tempObjItem[i];
                        break;
                    }
                }
            }
        }
        private void InitControlObject()
        {
            //设置当前的ConfigObject
            CurrentConfigObje = WizardHelper.ListScreens[ScreenNumber - 1];
            this.TexPort.Text = CurrentConfigObje.ListProperties.FirstOrDefault(p => p.PropertyID == 9).Value;
            this.IPTextBox.SetIP(CurrentConfigObje.ListProperties.FirstOrDefault(p => p.PropertyID == 7).Value);
            this.IPTextBox.IsEnabled = false;
            //获取DBBridge添加项
            List <ConfigObject> TempListItems = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == S1110Consts.RESOURCE_DBBRIDGE).ToList();

            ListDBBridgeItems.Clear();
            foreach (ConfigObject co in TempListItems)
            {
                PropertyValueEnumItem item = new PropertyValueEnumItem();
                item.Value   = co.ID.ToString();
                item.Display = co.Name;
                item.Info    = co;
                ListDBBridgeItems.Add(item);
            }
            //获取SFTP添加项
            TempListItems = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == S1110Consts.RESOURCE_SFTP).ToList();
            ListSFTPItems.Clear();
            foreach (ConfigObject co in TempListItems)
            {
                PropertyValueEnumItem item = new PropertyValueEnumItem();
                item.Value   = co.ID.ToString();
                item.Display = co.Name;
                item.Info    = co;
                ListSFTPItems.Add(item);
            }
            //录音服务器
            TempListItems = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == S1110Consts.RESOURCE_VOICESERVER).ToList();
            ListVoiceIDItems.Clear();
            foreach (ConfigObject co in TempListItems)
            {
                PropertyValueEnumItem item = new PropertyValueEnumItem();
                item.Value   = co.ID.ToString();
                item.Display = co.Name;
                item.Info    = co;
                ListVoiceIDItems.Add(item);
            }

            //sftp登录名
            ListSFTPUserItems.Clear();
            foreach (BasicUserInfo BasicInfo in WizardHelper.mListSftpUsers)
            {
                PropertyValueEnumItem item = new PropertyValueEnumItem();
                item.Display     = BasicInfo.Account;
                item.Description = BasicInfo.FullName;
                item.Value       = string.Format("{0}|{1}", BasicInfo.UserID, CurrentApp.Session.RentInfo.Token);
                item.Info        = BasicInfo;
                var temp = ListSFTPUserItems.FirstOrDefault(e => e.Value == item.Value);
                if (temp == null)
                {
                    ListSFTPUserItems.Add(item);
                }
            }
            //加载选中项
            var    propertyItem = CurrentConfigObje.ListProperties.FirstOrDefault(p => p.PropertyID == 11);
            string voiceid      = string.Empty;

            if (propertyItem != null)
            {
                voiceid = propertyItem.Value;
            }
            for (int index = 0; index < ListVoiceIDItems.Count; index++)
            {
                if (voiceid == ListVoiceIDItems[index].Value)
                {
                    this.CombVoiceID.SelectedIndex = index;
                }
            }

            propertyItem = CurrentConfigObje.ListProperties.FirstOrDefault(p => p.PropertyID == 15);
            string DB = string.Empty;

            if (propertyItem != null)
            {
                DB = propertyItem.Value;
            }
            for (int index = 0; index < ListDBBridgeItems.Count; index++)
            {
                if (DB == ListDBBridgeItems[index].Value)
                {
                    this.CombDBBridge.SelectedIndex = index;
                }
            }

            propertyItem = CurrentConfigObje.ListProperties.FirstOrDefault(p => p.PropertyID == 16);
            string sftp = string.Empty;

            if (propertyItem != null)
            {
                sftp = propertyItem.Value;
            }
            for (int index = 0; index < ListSFTPItems.Count; index++)
            {
                if (DB == ListSFTPItems[index].Value)
                {
                    this.CombSFTP.SelectedIndex = index;
                }
            }

            propertyItem = CurrentConfigObje.ListProperties.FirstOrDefault(p => p.PropertyID == 17);
            string sftpUser = string.Empty;

            if (propertyItem != null)
            {
                sftpUser = propertyItem.Value;
            }
            for (int index = 0; index < ListSFTPUserItems.Count; index++)
            {
                if (sftpUser == ListSFTPUserItems[index].Value)
                {
                    this.CombSFTPName.SelectedIndex = index;
                }
            }
        }
        private void InitControlObject()
        {
            //加载下载方式下拉项
            List <BasicInfoData> TempBasicInfo = WizardHelper.ListAllBasicInfos.Where(p => p.InfoID == 111000115).ToList();

            mListDownWayItems.Clear();
            foreach (BasicInfoData info in TempBasicInfo)
            {
                PropertyValueEnumItem propertyValueItem = new PropertyValueEnumItem();
                propertyValueItem.Value   = info.Value;
                propertyValueItem.Display =
                    CurrentApp.GetLanguageInfo(string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                                               info.Icon);
                propertyValueItem.Info = info;
                mListDownWayItems.Add(propertyValueItem);
            }
            //加载录音服务器下拉项
            List <ConfigObject> TempConfigObj = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 221).ToList();

            mListVoiceServiceItems.Clear();
            foreach (ConfigObject Obj in TempConfigObj)
            {
                PropertyValueEnumItem propertyValue = new PropertyValueEnumItem();
                propertyValue.Value   = Obj.ObjectID.ToString();
                propertyValue.Display = Obj.ToString();
                propertyValue.Info    = Obj;
                mListVoiceServiceItems.Add(propertyValue);
            }

            //生成291的ConfigObject对象
            if (DownLoadNumber > mListDownConfigObjs.Count)
            {
                //加载默认值
                this.IPTextBox.SetIP("127.0.0.1");
                this.TexPort.Text        = "";
                this.TexCatalog.Text     = "";
                this.TexLoginName.Text   = "";
                this.PasswLogin.Password = "";

                List <ObjectItem> tempObjItem = WizardHelper.ListAllObjectItem.Where(p => p.Type == 1).ToList();
                int j = 0;
                for (; j < tempObjItem.Count; j++)
                {
                    ConfigGroup tempCG = tempObjItem[j].Data as ConfigGroup;
                    if (tempCG.GroupID == 9 && tempCG.ChildType == 291)
                    {
                        DownloadObjectItem  = tempObjItem[j];
                        CurrentConfigObject = WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 291);
                        mListDownConfigObjs.Add(CurrentConfigObject);
                        break;
                    }
                }
            }
            else
            {
                CurrentConfigObject = mListDownConfigObjs[DownLoadNumber - 1];
            }
            for (int i = 0; i < CurrentConfigObject.ListProperties.Count; i++)
            {
                int    propertyID    = CurrentConfigObject.ListProperties[i].PropertyID;
                string propertyValue = CurrentConfigObject.ListProperties[i].Value;
                if (propertyValue == null || propertyValue == string.Empty)
                {
                    continue;
                }
                switch (propertyID)
                {
                case 11:
                    for (int k = 0; k < mListDownWayItems.Count; k++)
                    {
                        if (mListDownWayItems[k].Value == propertyValue)
                        {
                            this.CombDownWay.SelectedItem = mListDownWayItems[k]; break;
                        }
                    }
                    break;

                case 12:
                    for (int k = 0; k < mListVoiceServiceItems.Count; k++)
                    {
                        if (mListVoiceServiceItems[k].Value == propertyValue)
                        {
                            this.CombVoice.SelectedItem = mListVoiceServiceItems[k]; break;
                        }
                    }
                    break;

                case 13:
                    this.IPTextBox.SetIP(propertyValue);
                    break;

                case 14:
                    this.TexPort.Text = propertyValue;
                    break;

                case 15:
                    this.TexCatalog.Text = propertyValue;
                    break;

                case 911:
                    this.TexLoginName.Text = propertyValue;
                    break;

                case 912:
                    this.PasswLogin.Password = propertyValue;
                    break;
                }
            }
        }
Esempio n. 22
0
        private void InitControlObject()
        {
            ListScreenConfigObjs = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 232 && p.ParentID == ScreenSeviceConfigObj.ObjectID).ToList();
            //if (RecordAgreementNumber == 1)
            //{
            //    RecordAgreementNumber = ListAgreements.Count();
            //}
            int ListCount = ListScreenConfigObjs.Count;
            List <BasicInfoData> TempBasicInfo = WizardHelper.ListAllBasicInfos.Where(p => p.InfoID == 111000165).ToList();

            ListScreenStartupModeItems.Clear();
            foreach (BasicInfoData info in TempBasicInfo)
            {
                PropertyValueEnumItem propertyValueItem = new PropertyValueEnumItem();
                propertyValueItem.IsCheckedChanged += EnumItem_IsCheckedChanged;
                propertyValueItem.Value             = info.Value;
                propertyValueItem.Display           =
                    CurrentApp.GetLanguageInfo(string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                                               info.Icon);
                propertyValueItem.Info = info;
                ListScreenStartupModeItems.Add(propertyValueItem);
            }
            List <BasicInfoData> TempBasicInfoStop = WizardHelper.ListAllBasicInfos.Where(p => p.InfoID == 111000166).ToList();

            ListScreenStopModeItems.Clear();
            foreach (BasicInfoData info in TempBasicInfoStop)
            {
                PropertyValueEnumItem propertyValueItem = new PropertyValueEnumItem();
                propertyValueItem.IsCheckedChanged += StopEnumItem_IsCheckedChanged;
                propertyValueItem.Value             = info.Value;
                propertyValueItem.Display           =
                    CurrentApp.GetLanguageInfo(string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                                               info.Icon);
                propertyValueItem.Info = info;
                ListScreenStopModeItems.Add(propertyValueItem);
            }
            if (ListCount >= ScreenChanNumber)
            {
                //加载显示已有项
                CurrentConfigObj = ListScreenConfigObjs[ScreenChanNumber - 1];
                ResourceProperty ExtName = CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 12);
                if (ExtName != null)
                {
                    this.TexExtName.Text = ExtName.Value;
                }
                ResourceProperty mPropertyValue = CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 15);
                if (mPropertyValue != null)
                {
                    int value = 0;
                    if (int.TryParse(mPropertyValue.Value, out value))
                    {
                        for (int i = 0; i < ListScreenStartupModeItems.Count; i++)
                        {
                            if (ListScreenStartupModeItems[i].Value == value.ToString())
                            {
                                this.CombStartup.SelectedIndex = i;
                            }
                        }
                    }
                }
                ResourceProperty mStopPropertyValue = CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 16);
                if (mStopPropertyValue != null)
                {
                    int value = 0;
                    if (int.TryParse(mStopPropertyValue.Value, out value))
                    {
                        for (int i = 0; i < ListScreenStopModeItems.Count; i++)
                        {
                            if (ListScreenStopModeItems[i].Value == value.ToString())
                            {
                                this.CombStop.SelectedIndex = i;
                            }
                        }
                    }
                }
            }
            else
            {
                List <ObjectItem> tempObjItem = WizardHelper.ListAllObjectItem.Where(p => p.Type == 1).ToList();
                int ReadyNumber = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 232 && p.ParentID == ScreenSeviceConfigObj.ObjectID).ToList().Count();
                for (int i = 0; i < tempObjItem.Count; i++)
                {
                    ConfigGroup tempCG = tempObjItem[i].Data as ConfigGroup;
                    if (tempCG.GroupID == 1 && tempCG.ChildType == 232 && tempCG.ConfigObject == ScreenSeviceConfigObj)
                    {
                        int MinValue = tempCG.GroupInfo.IntValue01; int MaxValue = tempCG.GroupInfo.IntValue02;
                        if ((ReadyNumber + 1) > MaxValue || (ReadyNumber + 1) < MinValue)
                        {
                            return;
                        }
                        CurrentConfigObj = WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 232);
                        CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 3).Value = ScreenSeviceConfigObj.ObjectID.ToString();
                        ParentObjectItem = tempObjItem[i];
                        break;
                    }
                }
            }
        }
Esempio n. 23
0
 private void InitControlObject()
 {
     ListConcurrencies = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 224 && p.ParentID == RecordConfigObj.ObjectID).ToList();
     //if (RecordAgreementNumber == 1)
     //{
     //    RecordAgreementNumber = ListAgreements.Count();
     //}
     int ListCount = ListConcurrencies.Count;
     List<BasicInfoData> TempBasicInfo = WizardHelper.ListAllBasicInfos.Where(p => p.InfoID == 111000150).ToList();
     foreach (BasicInfoData info in TempBasicInfo)
     {
         PropertyValueEnumItem propertyValueItem = new PropertyValueEnumItem();
         propertyValueItem.IsCheckedChanged += EnumItem_IsCheckedChanged;
         propertyValueItem.Value = info.Value;
         propertyValueItem.Display =
             CurrentApp.GetLanguageInfo(string.Format("BID{0}{1}", info.InfoID, info.SortID.ToString("000")),
                 info.Icon);
         propertyValueItem.Info = info;
         ListConcurrencyItems.Add(propertyValueItem);
     }
     this.TexLicenseNumber.Text = "0";
     if (ListCount >= RecordConcurrencyNumber)
     {
         //加载显示已有项
         CurrentConfigObj = ListConcurrencies[RecordConcurrencyNumber - 1];
         ResourceProperty NetworkName = CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 12);
         if (NetworkName != null)
         {
             this.TexLicenseNumber.Text = NetworkName.Value;
         }
         ResourceProperty mPropertyValue = CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 11);
         if (mPropertyValue != null)
         {
             int value = 0;
             if (int.TryParse(mPropertyValue.Value, out value))
             {
                 for (int i = 0; i < ListConcurrencyItems.Count; i++)
                 {
                     if (ListConcurrencyItems[i].Value == value.ToString())
                     {
                         this.CombNumber.SelectedIndex = i;
                     }
                 }
             }
         }
     }
     else
     {
         List<ObjectItem> tempObjItem = WizardHelper.ListAllObjectItem.Where(p => p.Type == 1).ToList();
         int ReadyNumber = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 224 && p.ParentID == RecordConfigObj.ObjectID).ToList().Count();
         for (int i = 0; i < tempObjItem.Count; i++)
         {
             ConfigGroup tempCG = tempObjItem[i].Data as ConfigGroup;
             if (tempCG.GroupID == 28 && tempCG.ChildType == 224 && tempCG.ConfigObject == RecordConfigObj)
             {
                 int MinValue = tempCG.GroupInfo.IntValue01; int MaxValue = tempCG.GroupInfo.IntValue02;
                 if ((ReadyNumber + 1) > MaxValue || (ReadyNumber + 1) < MinValue)
                 { return; }
                 //WizardHelper.ListAllConfigObjects.Add(WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 222));
                 CurrentConfigObj = WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 224);
                 CurrentConfigObj.CurrentApp = CurrentApp;
                 CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 3).Value = RecordConfigObj.ObjectID.ToString();
                 ParentObjectItem = tempObjItem[i];
                 break;
             }
         }
     }
 }