Пример #1
0
 private void Init()
 {
     try
     {
         BackgroundWorker worker = new BackgroundWorker();
         worker.DoWork += (s, de) =>
         {
         };
         worker.RunWorkerCompleted += (s, re) =>
         {
             worker.Dispose();
             if (S5102App.GOptInfo == S5102Codes.OptAdd)
             {
                 CmbIcan.SelectedIndex   = 0;
                 BorderKwInfo.Visibility = Visibility.Visible;
             }
             if (S5102App.GOptInfo == S5102Codes.OptChange)
             {
                 _mKwInfo           = S5102App.GKwInfo;
                 TxtKeyword.Text    = S5102App.GKwInfo.StrKw;
                 CbEnable.IsChecked = S5102App.GKwInfo.State != 0;
                 SetImage();
                 BorderKwInfo.Visibility = Visibility.Collapsed;
             }
         };
         worker.RunWorkerAsync();
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Пример #2
0
 public AddKeywordPage()
 {
     _mKwInfo         = new KeywordInfoParam();
     _mKwConnectInfo  = new KwContentInfoParam();
     _mbSetAsKwConten = false;
     InitializeComponent();
     Loaded += UCCustomSetting_Loaded;
 }
Пример #3
0
        private bool UpdateKw(KeywordInfoParam kwInfo)
        {
            try
            {
                string strLog;
                var    webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S5101Codes.OptUpdateKw;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(kwInfo);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return(false);
                }
                webRequest.ListData.Add(optReturn.Data.ToString());
                var client = new Service51011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service51011"));
                //var client = new Service51011Client();
                var webReturn = client.UmpTaskOperation(webRequest);
                client.Close();

                CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("5101T00045", "Update"));
                if (!webReturn.Result)
                {
                    #region 写操作日志

                    strLog = string.Format("{0} {1} : {2}", Utils.FormatOptLogString("5101T00045"),
                                           Utils.FormatOptLogString("5101T00046"), webReturn.Message);
                    CurrentApp.WriteOperationLog(S5101Consts.OPT_Update.ToString(), ConstValue.OPT_RESULT_FAIL, strLog);

                    #endregion

                    CurrentApp.WriteLog(webReturn.Message);
                    ShowException(string.Format("{0}: {1}",
                                                CurrentApp.GetLanguageInfo("5101T00046", "Upate keyword Content Fail!"),
                                                webReturn.Message));
                    return(false);
                }
                #region 写操作日志

                strLog = string.Format("{0} {1}", Utils.FormatOptLogString("5101T00045"),
                                       Utils.FormatOptLogString("5101T00047"));
                CurrentApp.WriteOperationLog(S5101Consts.OPT_Update.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("5101T00047", "Update Success"));
                #endregion
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                return(false);
            }
            return(true);
        }
Пример #4
0
 private void Init()
 {
     if (S5101App.GOptInfo == S5101Codes.OptAdd)
     {
         CmbIcan.SelectedIndex   = 0;
         BorderKwInfo.Visibility = Visibility.Visible;
     }
     if (S5101App.GOptInfo == S5101Codes.OptChange)
     {
         _mKwInfo           = S5101App.GKwInfo;
         TxtKeyword.Text    = S5101App.GKwInfo.StrKw;
         CbEnable.IsChecked = S5101App.GKwInfo.State != 0;
         SetImage();
         BorderKwInfo.Visibility = Visibility.Collapsed;
     }
 }