private void IBackgroundWorkerF_DoWork(object sender, DoWorkEventArgs e)
        {
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            Service00003Client LService00003Client = null;

            List <string> LListWcfArgs = new List <string>();

            try
            {
                LBasicHttpBinding     = App.CreateBasicHttpBinding(true, 25);
                LEndpointAddress      = App.CreateEndpointAddress(IListConnectInfo[0], IListConnectInfo[1], true, "Service00003");
                LService00003Client   = new Service00003Client(LBasicHttpBinding, LEndpointAddress);
                I00003OperationReturn = LService00003Client.OperationMethodA(3, LListWcfArgs);
            }
            catch (Exception ex)
            {
                I00003OperationReturn.BoolReturn   = false;
                I00003OperationReturn.StringReturn = "UMP001E006" + App.GStrSpliterChar + ex.Message;
            }
            finally
            {
                if (LService00003Client != null)
                {
                    if (LService00003Client.State == CommunicationState.Opened)
                    {
                        LService00003Client.Close(); LService00003Client = null;
                    }
                }
            }
        }
        public static DataTable GetRentOnlineUser(string AStrRentToken, ref string AStrReturn)
        {
            DataTable LDataTableOnlineUser = new DataTable();

            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            Service00003Client LService00003Client = null;
            List <string>      LListWcfArgs        = new List <string>();

            try
            {
                AStrReturn = string.Empty;
                LDataTableOnlineUser.TableName = "T_100_" + AStrRentToken;

                List <string> LListStrDBProfile = App.GSystemMainWindow.GetCurrentDatabaseProfile();
                List <string> LListStrAppServer = App.GSystemMainWindow.GetCurrentAppServerConnection();

                LBasicHttpBinding   = App.CreateBasicHttpBinding(true, 25);
                LEndpointAddress    = App.CreateEndpointAddress(LListStrAppServer[0], LListStrAppServer[1], true, "Service00003");
                LService00003Client = new Service00003Client(LBasicHttpBinding, LEndpointAddress);

                foreach (string LStrSingleProfile in LListStrDBProfile)
                {
                    LListWcfArgs.Add(LStrSingleProfile);
                }
                LListWcfArgs.Add(AStrRentToken); LListWcfArgs.Add("01");

                I00003OperationReturn = LService00003Client.OperationMethodA(9, LListWcfArgs);
                if (!I00003OperationReturn.BoolReturn)
                {
                    AStrReturn = I00003OperationReturn.StringReturn;
                }
                else
                {
                    LDataTableOnlineUser           = I00003OperationReturn.DataSetReturn.Tables[0].Copy();
                    LDataTableOnlineUser.TableName = "T_100_" + AStrRentToken;
                }
            }
            catch (Exception ex)
            {
                AStrReturn = "C002002" + AscCodeToChr(27) + ex.Message;
            }
            finally
            {
                if (LService00003Client != null)
                {
                    if (LService00003Client.State == CommunicationState.Opened)
                    {
                        LService00003Client.Close(); LService00003Client = null;
                    }
                }
            }

            return(LDataTableOnlineUser);
        }
        private void IBackgroundWorkerA_DoWork(object sender, DoWorkEventArgs e)
        {
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            Service00003Client LService00003Client = null;

            List <string> LListWcfArgs = new List <string>();

            bool   LBoolCallReturn = true;
            string LStrCallReturn  = string.Empty;

            try
            {
                List <string> LListStrDBProfile = App.GSystemMainWindow.GetCurrentDatabaseProfile();
                List <string> LListStrAppServer = App.GSystemMainWindow.GetCurrentAppServerConnection();

                LBasicHttpBinding   = App.CreateBasicHttpBinding(true, 15);
                LEndpointAddress    = App.CreateEndpointAddress(LListStrAppServer[0], LListStrAppServer[1], true, "Service00003");
                LService00003Client = new Service00003Client(LBasicHttpBinding, LEndpointAddress);

                LListWcfArgs.Add(IStrLanguageID);
                foreach (string LStrSingleProfile in LListStrDBProfile)
                {
                    LListWcfArgs.Add(LStrSingleProfile);
                }
                LListWcfArgs.Add("R");
                I00003OperationReturn = LService00003Client.OperationMethodA(5, LListWcfArgs);
                if (!I00003OperationReturn.BoolReturn)
                {
                    return;
                }
                I00003OperationReturn.BoolReturn   = WriteDataToXMLFile(I00003OperationReturn.DataSetReturn.Tables[0], ref LStrCallReturn);
                I00003OperationReturn.StringReturn = LStrCallReturn;
            }
            catch (Exception ex)
            {
                I00003OperationReturn.BoolReturn   = false;
                I00003OperationReturn.StringReturn = "UMP000E003" + App.GStrSpliterChar + ex.Message;
            }
            finally
            {
                if (LService00003Client != null)
                {
                    if (LService00003Client.State == CommunicationState.Opened)
                    {
                        LService00003Client.Close(); LService00003Client = null;
                    }
                }
            }
        }
        public static bool CancellationOnlineUser(ListViewItemSingleOnlineUser ASingleOnlineUser, ref string AStrReturn)
        {
            bool LBoolReturn = true;

            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            Service00003Client LService00003Client = null;
            List <string>      LListWcfArgs        = new List <string>();

            try
            {
                AStrReturn = string.Empty;
                List <string> LListStrDBProfile = App.GSystemMainWindow.GetCurrentDatabaseProfile();
                List <string> LListStrAppServer = App.GSystemMainWindow.GetCurrentAppServerConnection();

                LBasicHttpBinding   = App.CreateBasicHttpBinding(true, 25);
                LEndpointAddress    = App.CreateEndpointAddress(LListStrAppServer[0], LListStrAppServer[1], true, "Service00003");
                LService00003Client = new Service00003Client(LBasicHttpBinding, LEndpointAddress);


                foreach (string LStrSingleProfile in LListStrDBProfile)
                {
                    LListWcfArgs.Add(LStrSingleProfile);
                }
                LListWcfArgs.Add(ASingleOnlineUser.RentToken); LListWcfArgs.Add("02");
                LListWcfArgs.Add(ASingleOnlineUser.SessionID);

                I00003OperationReturn = LService00003Client.OperationMethodA(9, LListWcfArgs);
                LBoolReturn           = I00003OperationReturn.BoolReturn;
                AStrReturn            = I00003OperationReturn.StringReturn;
            }
            catch (Exception ex)
            {
                AStrReturn = "C002003" + AscCodeToChr(27) + ex.Message;
            }
            finally
            {
                if (LService00003Client != null)
                {
                    if (LService00003Client.State == CommunicationState.Opened)
                    {
                        LService00003Client.Close(); LService00003Client = null;
                    }
                }
            }

            return(LBoolReturn);
        }
        private void IBackgroundWorkerB_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker LBackgroundWorker = sender as BackgroundWorker;

            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            Service00003Client LService00003Client = null;

            List <string> LListWcfArgs   = new List <string>();
            int           LIntCurrentRow = 0;

            string LStrColumnName  = string.Empty;
            string LStrColumnValue = string.Empty;


            try
            {
                List <string> LListStrDBProfile = App.GSystemMainWindow.GetCurrentDatabaseProfile();
                List <string> LListStrAppServer = App.GSystemMainWindow.GetCurrentAppServerConnection();

                LBasicHttpBinding   = App.CreateBasicHttpBinding(true, 15);
                LEndpointAddress    = App.CreateEndpointAddress(LListStrAppServer[0], LListStrAppServer[1], true, "Service00003");
                LService00003Client = new Service00003Client(LBasicHttpBinding, LEndpointAddress);

                IIntAllRows = IXMLNodeTableDataRowsList.ChildNodes.Count;
                foreach (XmlNode LXmlNodeSingleRow in IXMLNodeTableDataRowsList)
                {
                    LIntCurrentRow += 1;
                    LBackgroundWorker.ReportProgress(LIntCurrentRow);

                    LListWcfArgs.Clear();
                    foreach (string LStrSingleProfile in LListStrDBProfile)
                    {
                        LListWcfArgs.Add(LStrSingleProfile);
                    }
                    LListWcfArgs.Add(IStrLanguageID);
                    LListWcfArgs.Add(IStrImportOptions);
                    foreach (XmlNode LXmlNodeSingleColumn in LXmlNodeSingleRow.ChildNodes)
                    {
                        LStrColumnName  = LXmlNodeSingleColumn.Name;
                        LStrColumnValue = LXmlNodeSingleColumn.InnerText;
                        if (string.IsNullOrEmpty(LStrColumnValue))
                        {
                            LStrColumnValue = "";
                        }
                        LListWcfArgs.Add(LStrColumnName + App.GStrSpliterChar + LStrColumnValue);
                    }
                    I00003OperationReturn = LService00003Client.OperationMethodA(7, LListWcfArgs);
                    if (!I00003OperationReturn.BoolReturn)
                    {
                        IBoolHaveError = true;
                    }
                }
            }
            catch (Exception ex)
            {
                IBoolHaveError = true;
                I00003OperationReturn.BoolReturn   = false;
                I00003OperationReturn.StringReturn = "UMP000E006" + App.GStrSpliterChar + ex.Message;
            }
            finally
            {
                if (LService00003Client != null)
                {
                    if (LService00003Client.State == CommunicationState.Opened)
                    {
                        LService00003Client.Close(); LService00003Client = null;
                    }
                }
            }
        }
Beispiel #6
0
        private void IBackgroundWorkerB_DoWork(object sender, DoWorkEventArgs e)
        {
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            Service00003Client LService00003Client = null;

            List <string> LListWcfArgs = new List <string>();

            try
            {
                List <string> LListStrDBProfile = App.GSystemMainWindow.GetCurrentDatabaseProfile();
                List <string> LListStrAppServer = App.GSystemMainWindow.GetCurrentAppServerConnection();

                //foreach (string LStrSingleProfile in LListStrDBProfile) { LListWcfArgs.Add(LStrSingleProfile); }

                LBasicHttpBinding   = App.CreateBasicHttpBinding(true, 15);
                LEndpointAddress    = App.CreateEndpointAddress(LListStrAppServer[0], LListStrAppServer[1], true, "Service00003");
                LService00003Client = new Service00003Client(LBasicHttpBinding, LEndpointAddress);

                foreach (ListViewItemSingle LListViewItemSingleLanguage in IListObservableCollectionLanguagePackage)
                {
                    if (LListViewItemSingleLanguage.DataChangeStatus == ListViewItemDataChangeStatus.IsDefault && LListViewItemSingleLanguage.TipChangeStatus == ListViewItemTipChangeStatus.IsDefault)
                    {
                        continue;
                    }
                    LListWcfArgs.Clear();
                    foreach (string LStrSingleProfile in LListStrDBProfile)
                    {
                        LListWcfArgs.Add(LStrSingleProfile);
                    }
                    LListWcfArgs.Add(LListViewItemSingleLanguage.LanguageCode.ToString());
                    LListWcfArgs.Add(LListViewItemSingleLanguage.MessageID);
                    if (LListViewItemSingleLanguage.DataChangeStatus == ListViewItemDataChangeStatus.IsChanged)
                    {
                        LListWcfArgs.Add("C005" + App.GStrSpliterChar + LListViewItemSingleLanguage.MessageContentText01);
                        LListWcfArgs.Add("C006" + App.GStrSpliterChar + LListViewItemSingleLanguage.MessageContentText02);
                    }
                    if (LListViewItemSingleLanguage.TipChangeStatus == ListViewItemTipChangeStatus.IsChanged)
                    {
                        LListWcfArgs.Add("C007" + App.GStrSpliterChar + LListViewItemSingleLanguage.MessageTipDisplay01);
                        LListWcfArgs.Add("C008" + App.GStrSpliterChar + LListViewItemSingleLanguage.MessageTipDisplay02);
                    }
                    I00003OperationReturn = LService00003Client.OperationMethodA(6, LListWcfArgs);
                    if (I00003OperationReturn.BoolReturn)
                    {
                        LListViewItemSingleLanguage.DataChangeStatus      = ListViewItemDataChangeStatus.IsDefault;
                        LListViewItemSingleLanguage.TipChangeStatus       = ListViewItemTipChangeStatus.IsDefault;
                        LListViewItemSingleLanguage.MessageContentTextOld = LListViewItemSingleLanguage.MessageContentText01 + LListViewItemSingleLanguage.MessageContentText02;
                        LListViewItemSingleLanguage.MessageTipDisplayOld  = LListViewItemSingleLanguage.MessageTipDisplay01 + LListViewItemSingleLanguage.MessageTipDisplay02;
                        OperationEventArgs LEventArgs = new OperationEventArgs();
                        LEventArgs.StrElementTag = "CSLANG";
                        LEventArgs.ObjSource     = LListViewItemSingleLanguage;
                        IOperationEvent(this, LEventArgs);
                    }
                    else
                    {
                        IBoolHasSaveError = true;
                    }
                }
            }
            catch (Exception ex)
            {
                I00003OperationReturn.BoolReturn   = false;
                I00003OperationReturn.StringReturn = "UMP001E007" + App.GStrSpliterChar + ex.Message;
            }
            finally
            {
                if (LService00003Client != null)
                {
                    if (LService00003Client.State == CommunicationState.Opened)
                    {
                        LService00003Client.Close(); LService00003Client = null;
                    }
                }
            }
        }