Beispiel #1
0
        private void SaveCTIConfig()
        {
            Init();
            //生成242ConfigObject,绑给CTIConfigObject的ListChildObject,写入CTIConfigObject是CTI类型属性值。将CTIConfigObject写入mList

            if (this.ComCTIType.SelectedIndex != -1)
            {
                var propertyItem = this.ComCTIType.SelectedItem as PropertyValueEnumItem;
                if (propertyItem != null)
                {
                    IntCTIType = propertyItem.Value;
                }
                var property = CTIConfigObject.ListProperties.FirstOrDefault(p => p.PropertyID == 11);
                if (property != null)
                {
                    property.Value = IntCTIType;
                }
            }
            ConfigObject CTIGroup    = WizardHelper.CreateNewConfigObject(CTIConfigObject, 242);
            var          property242 = CTIGroup.ListProperties.FirstOrDefault(p => p.PropertyID == 11);

            if (property242 != null)
            {
                property242.Value = IntCTIType;
            }
            mListCTIConfigObjs.Add(CTIConfigObject);
            mListCTIConfigObjs.Add(CTIGroup);
            MainPage.RefreshConfigObjectItem(CTIObjItem);
            CTICount++;
        }
        private void InitControlObject()
        {
            ConfigObject TempConfig = mListCtiConfigObjs.FirstOrDefault(p => p.ObjectID.ToString().Length > 3 && p.ObjectID.ToString().Substring(0, 3) == "242");

            if (TempConfig != null)
            {
                CurrentConfigObj = WizardHelper.CreateNewConfigObject(TempConfig, 241);
                this.IPTexCTI.SetIP(CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 11).Value);
                this.TexPort.Text = CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 12).Value;
            }
        }
        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;
                }
            }
        }
Beispiel #4
0
        private void Init()//在保存前生成243
        {
            //生成243的ConfigObject对象,之前要检查是否已经建立了这个类型的CTI对象
            List <ConfigObject> TempReadyCTI = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 243).ToList();
            var PageValue = this.ComCTIType.SelectedItem; bool IsFind = false;

            if (PageValue != null)
            {
                string pValue = (PageValue as PropertyValueEnumItem).Value;
                for (int i = 0; i < TempReadyCTI.Count; i++)
                {
                    string properValueofList = TempReadyCTI[i].ListProperties.FirstOrDefault(p => p.PropertyID == 11).Value;
                    if (properValueofList == pValue)
                    {
                        IsFind          = true;
                        CTIConfigObject = TempReadyCTI[i];
                        break;
                    }
                }
            }
            List <ObjectItem> tempObjItem = WizardHelper.ListAllObjectItem.Where(p => p.Type == 1).ToList();
            //int ReadyNumber = WizardHelper.ListAllConfigObjects.Where(p => p.ObjectType == 243).ToList().Count();
            int j = 0; ConfigGroup tempCG = new ConfigGroup();

            for (; j < tempObjItem.Count; j++)
            {
                tempCG = tempObjItem[j].Data as ConfigGroup;
                if (tempCG.GroupID == 51 && tempCG.ChildType == 243 && tempCG.TypeID == 0)
                {
                    CTIObjItem = tempObjItem[j];
                    //int MinValue = tempCG.GroupInfo.IntValue01; int MaxValue = tempCG.GroupInfo.IntValue02;
                    //if ((ReadyNumber + 1) > MaxValue || (ReadyNumber + 1) < MinValue)
                    //{ return; }
                    //CTIConfigObject = WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 243);
                    break;
                }
            }
            if (!IsFind)
            {
                CTIConfigObject = WizardHelper.CreateNewConfigObject(tempCG.ConfigObject, 243);
            }
        }
Beispiel #5
0
        private void InitControlObject()
        {
            ConfigObject TempConfig = mListCtiConfigObjs.FirstOrDefault(p => p.ObjectID.ToString().Length > 3 && p.ObjectID.ToString().Substring(0, 3) == "242");

            if (TempConfig != null)
            {
                CurrentConfigObj      = WizardHelper.CreateNewConfigObject(TempConfig, 241);
                this.TexVDU.Text      = CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 21).Value;
                this.TexADU.Text      = CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 22).Value;
                this.TexFileName.Text = CurrentConfigObj.ListProperties.Find(p => p.PropertyID == 24).Value;
                if (CurrentConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 23).Value == "1")
                {
                    this.RadBADUYes.IsChecked = true;
                }
                else
                {
                    this.RadBADUNo.IsChecked = true;
                }
            }
        }
Beispiel #6
0
        public void SaveCTIConfig()
        {
            //创建一个configobject241
            ConfigObject TempConfig = mListCtiConfigObjs.FirstOrDefault(p => p.ObjectID.ToString().Length > 3 && p.ObjectID.ToString().Substring(0, 3) == "242");

            if (TempConfig != null)
            {
                ConfigObject CurrenPageCTIConfigObj = WizardHelper.CreateNewConfigObject(TempConfig, 241);
                if (PasswLoginPassword.Password != null && PasswLoginPassword.Password != string.Empty)
                {
                    ResourceProperty property = CurrenPageCTIConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 912);
                    if (property != null)
                    {
                        property.Value = this.PasswLoginPassword.Password;
                    }
                }
                if (this.TexLoginName.Text != null && this.TexLoginName.Text != string.Empty)
                {
                    ResourceProperty PropertyName = CurrenPageCTIConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 911);
                    if (PropertyName != null)
                    {
                        PropertyName.Value = this.TexLoginName.Text;
                    }
                }
                if (IsServiceName)
                {
                    if (this.CombServiceName.Text != null && this.CombServiceName.Text != string.Empty)
                    {
                        ResourceProperty PropertyServiceName = CurrenPageCTIConfigObj.ListProperties.FirstOrDefault(p => p.PropertyID == 14);
                        if (PropertyServiceName != null)
                        {
                            PropertyServiceName.Value = this.TexLoginName.Text;
                        }
                    }
                }
                CurrenPageCTIConfigObj.GetBasicPropertyValues();
                //TempConfig.ListChildObjects.Add(CurrenPageCTIConfigObj);
                mListCtiConfigObjs.Add(CurrenPageCTIConfigObj);
            }
            ObjectItem ObjItem243 = new ObjectItem(); ObjectItem ObjItem242 = new ObjectItem(); ObjectItem ObjItem241 = new ObjectItem();

            if (mListCtiConfigObjs.Count == 3)
            {
                for (int i = 0; i < 3; i++)
                {
                    WizardHelper.ListAllConfigObjects.Add(mListCtiConfigObjs[i]);
                    switch (i)
                    {
                    case 0:
                        ObjItem243 = MainPage.CreateNewObjectItem(CtiObjItem, mListCtiConfigObjs[i], false);
                        MainPage.RefreshConfigObjectItem(ObjItem243);
                        break;

                    case 1:
                        ObjItem242 = MainPage.CreateNewObjectItem(ObjItem243, mListCtiConfigObjs[i], false);
                        MainPage.RefreshConfigObjectItem(ObjItem242);
                        break;

                    case 2:
                        ObjItem241 = MainPage.CreateNewObjectItem(ObjItem242, mListCtiConfigObjs[i], false);
                        MainPage.RefreshConfigObjectItem(ObjItem241);
                        break;
                    }
                }
            }
            //MainPage.RefreshConfigObjectItem(CtiObjItem);
        }
Beispiel #7
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;
                    }
                }
            }
        }
        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;
                }
            }
        }