Esempio n. 1
0
 private void Init()
 {
     try
     {
         BackgroundWorker worker = new BackgroundWorker();
         worker.DoWork += (s, de) =>
         {
         };
         worker.RunWorkerCompleted += (s, re) =>
         {
             worker.Dispose();
         };
         worker.RunWorkerAsync();
         if (S5102App.GOptInfo == S5102Codes.OptAdd)
         {
             _mKwConnectInfo = new KwContentInfoParam();
         }
         if (S5102App.GOptInfo == S5102Codes.OptChange)
         {
             TxtKwContent.Text  = S5102App.GKwConnectInfo.StrKwContent;
             CbEnable.IsChecked = S5102App.GKwConnectInfo.State != 0;
             _mKwConnectInfo    = S5102App.GKwConnectInfo;
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Esempio n. 2
0
 public AddKeywordPage()
 {
     _mKwInfo         = new KeywordInfoParam();
     _mKwConnectInfo  = new KwContentInfoParam();
     _mbSetAsKwConten = false;
     InitializeComponent();
     Loaded += UCCustomSetting_Loaded;
 }
Esempio n. 3
0
        private bool AddKwContent(KwContentInfoParam kwConnectInfoParam)
        {
            try
            {
                string strLog;
                var    webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S5101Codes.OptAddKwContent;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(kwConnectInfoParam);
                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("5101T00029", "Create"));
                if (!webReturn.Result)
                {
                    #region 写操作日志

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

                    #endregion

                    CurrentApp.WriteLog(webReturn.Message);
                    ShowException(webReturn.Message);
                    return(false);
                }

                #region 写操作日志

                strLog = string.Format("{0} {1}", Utils.FormatOptLogString("5101T00029"),
                                       Utils.FormatOptLogString("5101T00039"));
                CurrentApp.WriteOperationLog(S5101Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                #endregion

                CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("5101T00039", "Create Success"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                return(false);
            }
            return(true);
        }
Esempio n. 4
0
        protected override void Init()
        {
            base.Init();

            try
            {
                GKwConnectInfo = new KwContentInfoParam();
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex.Message);
            }
        }
Esempio n. 5
0
 private void Init()
 {
     if (S5101App.GOptInfo == S5101Codes.OptAdd)
     {
         _mKwConnectInfo = new KwContentInfoParam();
     }
     if (S5101App.GOptInfo == S5101Codes.OptChange)
     {
         TxtKwContent.Text  = S5101App.GKwConnectInfo.StrKwContent;
         CbEnable.IsChecked = S5101App.GKwConnectInfo.State != 0;
         _mKwConnectInfo    = S5101App.GKwConnectInfo;
     }
 }
Esempio n. 6
0
 public AddKwContentPage()
 {
     InitializeComponent();
     _mKwConnectInfo = new KwContentInfoParam();
     Loaded         += UCCustomSetting_Loaded;
 }