public static OperationDataArgs UserLogOff()
        {
            OperationDataArgs  result  = new OperationDataArgs();
            BasicHttpBinding   binding = Common.CreateBasicHttpBinding(60);
            EndpointAddress    adress  = Common.CreateEndPoint("HTTP", App.GCurrentUmpServer.Host, App.GCurrentUmpServer.Port, "WcfServices", "Service00000");
            Service00000Client client  = new Service00000Client(binding, adress);

            try
            {
                List <string> lstParams = new List <string>();
                string        LStrVerificationCode004 = Common.CreateVerificationCode(PFShareClassesC.EncryptionAndDecryption.UMPKeyAndIVType.M004);
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(App.GCurrentUser.TenantID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(App.GCurrentUser.UserID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(App.GCurrentUser.SessionID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                result = client.OperationMethodA(12, lstParams);
            }
            catch (Exception ex)
            {
                result.BoolReturn   = false;
                result.StringReturn = ex.Message;
            }
            finally
            {
                if (client.State == CommunicationState.Opened)
                {
                    client.Close();
                }
            }
            return(result);
        }
        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;
                    }
                }
            }
        }
Exemple #3
0
        private void IBWSaveData_DoWork(object sender, DoWorkEventArgs e)
        {
            Service00000Client LService00000Client = null;
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            List <string>      LListStrWcfArgs     = new List <string>();

            try
            {
                LListStrWcfArgs = e.Argument as List <string>;

                LBasicHttpBinding = WebHelper.CreateBasicHttpBinding();
                LEndpointAddress  = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00000");
                OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);
                LWCFOperationReturn = LService00000Client.OperationMethodA(22, LListStrWcfArgs);
                IStrCallReturn      = LWCFOperationReturn.StringReturn;
                IBoolCallReturn     = LWCFOperationReturn.BoolReturn;
                IListStrAfterSave.Clear();
                if (IBoolCallReturn)
                {
                    foreach (string LStrSingleArgs in LListStrWcfArgs)
                    {
                        IListStrAfterSave.Add(LStrSingleArgs);
                    }
                    IListStrAfterSave[4] = IStrCallReturn;
                }
            }
            catch (Exception ex)
            {
                IBoolCallReturn = false;
                IStrCallReturn  = ex.ToString();
            }
        }
Exemple #4
0
        /// <summary>
        /// 退出系统
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ButtonCloseConnect_Click(object sender, RoutedEventArgs e)
        {
            //断开连接
            OperationDataArgs result = ServerConfigOperationInServer.UserLogOff();

            this.Close();
        }
Exemple #5
0
        private void IBackgroundWorkerObtainNeededData_DoWork(object sender, DoWorkEventArgs e)
        {
            List <string> LListStrWcfArgs = new List <string>();

            Service00000Client LService00000Client = null;
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;

            IDataTableMAMTSupportL = new DataTable();
            LListStrWcfArgs.Add(App.GClassSessionInfo.LangTypeInfo.LangID.ToString());

            LBasicHttpBinding = WebHelper.CreateBasicHttpBinding();
            LEndpointAddress  = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00000");
            OperationDataArgs LWCFOperationReturn = new OperationDataArgs();

            LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);
            LWCFOperationReturn = LService00000Client.OperationMethodA(31, LListStrWcfArgs);
            if (LWCFOperationReturn.BoolReturn)
            {
                IDataTableMAMTSupportL = LWCFOperationReturn.DataSetReturn.Tables[0];
            }
            else
            {
                IDataTableMAMTSupportL = null;
            }
            LService00000Client.Close();
            LService00000Client = null;
        }
Exemple #6
0
        private void IBackgroundWorkerObtainInitTableData_DoWork(object sender, DoWorkEventArgs e)
        {
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            Service00001Client LService00001Client = null;

            string        LStrDatabaseVersion  = e.Argument as string;
            List <string> LListStrWcfArguments = new List <string>();

            LListStrWcfArguments.Add(LStrDatabaseVersion);
            LBasicHttpBinding = WebHelper.CreateBasicHttpBinding();
            LEndpointAddress  = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00001");
            OperationDataArgs LWCFOperationReturn = new OperationDataArgs();

            LService00001Client = new Service00001Client(LBasicHttpBinding, LEndpointAddress);
            LWCFOperationReturn = LService00001Client.OperationMethodA(13, LListStrWcfArguments);
            if (LWCFOperationReturn.BoolReturn)
            {
                IDataTableInitTablesData = LWCFOperationReturn.DataSetReturn.Tables[0];
            }
            else
            {
                IDataTableInitTablesData = null;
            }
            LService00001Client.Close();
            LService00001Client = null;
        }
        /// <summary>
        /// 用户登录(检查密码是否正确 是否已经在另一台机器登录等)
        /// </summary>
        /// <param name="strHost"></param>
        /// <param name="strPort"></param>
        /// <param name="strUser"></param>
        /// <param name="strPwd"></param>
        /// <param name="strLoginMethod"></param>
        /// <param name="strClientMachineName"></param>
        /// <returns></returns>
        public static OperationDataArgs UserLogin(string strHost, string strPort, string strUser, string strPwd, string strLoginMethod, string strClientMachineName)
        {
            OperationDataArgs  result  = new OperationDataArgs();
            BasicHttpBinding   binding = Common.CreateBasicHttpBinding(60);
            EndpointAddress    adress  = Common.CreateEndPoint("HTTP", strHost, strPort, "WcfServices", "Service00000");
            Service00000Client client  = new Service00000Client(binding, adress);

            try
            {
                List <string> lstParams = new List <string>();
                string        LStrVerificationCode004 = Common.CreateVerificationCode(PFShareClassesC.EncryptionAndDecryption.UMPKeyAndIVType.M004);
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strUser, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strPwd, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strLoginMethod, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strClientMachineName, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                result = client.OperationMethodA(11, lstParams);
            }
            catch (Exception ex)
            {
                result.BoolReturn   = false;
                result.StringReturn = ex.Message;
            }
            finally
            {
                if (client.State == CommunicationState.Opened)
                {
                    client.Close();
                }
            }
            return(result);
        }
Exemple #8
0
        /// <summary>
        /// 加载语言包
        /// </summary>
        public static void LoadApplicationLanguages()
        {
            Service00000Client LService00000Client = null;
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            List <string>      LListStrWcfArgs     = new List <string>();

            try
            {
                LBasicHttpBinding = WebHelper.CreateBasicHttpBinding();
                LEndpointAddress  = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00000");
                OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);

                IDataTableLanguage = new DataTable();
                LListStrWcfArgs.Add(GClassSessionInfo.LangTypeInfo.LangID.ToString());
                LWCFOperationReturn = LService00000Client.OperationMethodA(33, LListStrWcfArgs);
                if (LWCFOperationReturn.BoolReturn)
                {
                    IDataTableLanguage = LWCFOperationReturn.DataSetReturn.Tables[0];
                }
            }
            catch { }
            finally
            {
                if (LService00000Client != null)
                {
                    if (LService00000Client.State == CommunicationState.Opened)
                    {
                        LService00000Client.Close();
                    }
                }
            }
        }
Exemple #9
0
        public static bool UserSignOutSystem(string AStrExitType, ref string AStrMessage)
        {
            bool LBoolReturn = true;

            Service00000Client LService00000Client     = null;
            BasicHttpBinding   LBasicHttpBinding       = null;
            EndpointAddress    LEndpointAddress        = null;
            List <string>      LListStrSignOutArgs     = new List <string>();
            string             LStrVerificationCode004 = string.Empty;
            string             LStrRentCode5           = string.Empty;
            string             LStrUserID    = string.Empty;
            string             LStrSessionID = string.Empty;

            try
            {
                if (!string.IsNullOrEmpty(GClassSessionInfo.UserInfo.Account))
                {
                    LStrVerificationCode004 = App.CreateVerificationCode(PFShareClassesC.EncryptionAndDecryption.UMPKeyAndIVType.M004);

                    LStrRentCode5 = GClassSessionInfo.RentInfo.Token;
                    LStrRentCode5 = EncryptionAndDecryption.EncryptDecryptString(LStrRentCode5, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
                    LListStrSignOutArgs.Add(LStrRentCode5);

                    LStrUserID = GClassSessionInfo.UserInfo.UserID.ToString();
                    LStrUserID = EncryptionAndDecryption.EncryptDecryptString(LStrUserID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
                    LListStrSignOutArgs.Add(LStrUserID);

                    LStrSessionID = GClassSessionInfo.SessionID;
                    LStrSessionID = EncryptionAndDecryption.EncryptDecryptString(LStrSessionID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
                    LListStrSignOutArgs.Add(GClassSessionInfo.SessionID);

                    LBasicHttpBinding = WebHelper.CreateBasicHttpBinding();
                    LEndpointAddress  = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00000");
                    OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                    LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);
                    LWCFOperationReturn = LService00000Client.OperationMethodA(12, LListStrSignOutArgs);
                }
            }
            catch (Exception ex)
            {
                LBoolReturn = false;
                AStrMessage = ex.ToString();
            }
            finally
            {
                if (LService00000Client != null)
                {
                    if (LService00000Client.State == CommunicationState.Opened)
                    {
                        LService00000Client.Close();
                    }
                }
            }

            return(LBoolReturn);
        }
        /// <summary>
        /// 根据ObjectID和Page获得对应的语言
        /// </summary>
        /// <param name="strUmpServerPort"></param>
        /// <param name="strUmpServerHost"></param>
        /// <param name="strDBHost"></param>
        /// <param name="strDBPort"></param>
        /// <param name="strMessageID"></param>
        /// <returns></returns>
        public static string GetLanguageItemInDBByObjectIDAndPage(ServerInfomation UmpServer, DBInfo dbInfo, string strObjectID, string strLanCode, string strPage)
        {
            string strConnString = string.Empty;

            switch (dbInfo.DbType)
            {
            case (int)Enums.DBType.MSSQL:
                strConnString = App.CreateMSSqlConnString(dbInfo);
                break;

            case (int)Enums.DBType.Oracle:
                strConnString = App.CreateOracleConnString(dbInfo);
                break;
            }
            string             strMessageContent = string.Empty;
            OperationDataArgs  result            = new OperationDataArgs();
            BasicHttpBinding   binding           = Common.CreateBasicHttpBinding(60);
            EndpointAddress    adress            = Common.CreateEndPoint("HTTP", UmpServer.Host, UmpServer.Port, "WcfServices", "Service00000");
            Service00000Client client            = new Service00000Client(binding, adress);

            try
            {
                List <string> lstParams = new List <string>();
                lstParams.Add(dbInfo.DbType.ToString());
                lstParams.Add(strConnString);
                lstParams.Add(strLanCode);
                lstParams.Add("M21");
                lstParams.Add("0");
                lstParams.Add(strPage);
                result = client.OperationMethodA(8, lstParams);
            }
            catch (Exception ex)
            {
                result.BoolReturn   = false;
                result.StringReturn = ex.Message;
            }
            finally
            {
                if (client.State == CommunicationState.Opened)
                {
                    client.Close();
                }
            }
            if (result.BoolReturn)
            {
                if (result.DataSetReturn.Tables.Count > 0)
                {
                    List <DataRow> lstRows = result.DataSetReturn.Tables[0].Select("C012 = '" + strObjectID + "'").ToList();
                    if (lstRows.Count > 0)
                    {
                        strMessageContent = lstRows[0]["C005"].ToString();
                    }
                }
            }
            return(strMessageContent);
        }
        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);
        }
        void LoginWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            List <string> lstArgs = e.Argument as List <string>;

            //获得该UMP服务器上配置的数据库信息
            lstDBsInUmp = ServerConfigOperationInServer.GetAllDBs(lstArgs[1], lstArgs[2]);

            string strHostName = System.Net.Dns.GetHostName();

            LoginResult = ServerConfigOperationInServer.UserLogin(lstArgs[1], lstArgs[2], lstArgs[3], lstArgs[4], lstArgs[0], strHostName);
        }
        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 IBackgroundWorkerObtainDatabasesLogins_DoWork(object sender, DoWorkEventArgs e)
        {
            BasicHttpBinding LBasicHttpBinding = null;
            EndpointAddress  LEndpointAddress  = null;

            IWCFOperationDataArgs = new OperationDataArgs();
            Service00001Client LService00001Client = null;

            List <string> LListStrDatabaseServerProfile = e.Argument as List <string>;

            LBasicHttpBinding     = WebHelper.CreateBasicHttpBinding();
            LEndpointAddress      = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00001");
            LService00001Client   = new Service00001Client(LBasicHttpBinding, LEndpointAddress);
            IWCFOperationDataArgs = LService00001Client.OperationMethodA(204, LListStrDatabaseServerProfile);
            LService00001Client.Close();
            LService00001Client = null;
        }
        public static List <DBInfo> GetAllDBs(string strHost, string strPort)
        {
            List <DBInfo>      lstResult = new List <DBInfo>();
            BasicHttpBinding   binding   = Common.CreateBasicHttpBinding(60);
            EndpointAddress    adress    = Common.CreateEndPoint("HTTP", strHost, strPort, "WcfServices", "Service00000");
            Service00000Client client    = new Service00000Client(binding, adress);

            try
            {
                OperationDataArgs resultArgs = client.OperationMethodA(5, null);
                if (resultArgs.BoolReturn)
                {
                    DBInfo  dbInfo;
                    DataRow row;
                    int     iDBtype = 0;
                    string  LStrVerificationCode = Common.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
                    for (int i = 0; i < resultArgs.DataSetReturn.Tables[0].Rows.Count; i++)
                    {
                        row    = resultArgs.DataSetReturn.Tables[0].Rows[i];
                        dbInfo = new DBInfo();
                        int.TryParse(row["DBType"].ToString(), out iDBtype);
                        dbInfo.DbType      = iDBtype;
                        dbInfo.Host        = EncryptionAndDecryption.EncryptDecryptString(row["ServerHost"].ToString(), LStrVerificationCode, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        dbInfo.Port        = EncryptionAndDecryption.EncryptDecryptString(row["ServerPort"].ToString(), LStrVerificationCode, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        dbInfo.ServiceName = EncryptionAndDecryption.EncryptDecryptString(row["NameService"].ToString(), LStrVerificationCode, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        dbInfo.LoginName   = EncryptionAndDecryption.EncryptDecryptString(row["LoginID"].ToString(), LStrVerificationCode, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        dbInfo.Password    = EncryptionAndDecryption.EncryptDecryptString(row["LoginPwd"].ToString(), LStrVerificationCode, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        lstResult.Add(dbInfo);
                    }
                }
            }
            catch
            {
            }
            finally
            {
                if (client.State == CommunicationState.Opened)
                {
                    client.Close();
                }
            }

            return(lstResult);
        }
Exemple #17
0
        public void Load11009Data()
        {
            Service00000Client LService00000Client = null;
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            List <string>      LListStrWcfArgs     = new List <string>();

            try
            {
                IDataTable11009 = new DataTable();

                LListStrWcfArgs.Add(Session.DatabaseInfo.TypeID.ToString());
                LListStrWcfArgs.Add(Session.DatabaseInfo.GetConnectionString());
                LListStrWcfArgs.Add(Session.RentInfo.Token);
                LBasicHttpBinding = WebHelper.CreateBasicHttpBinding(Session);
                LEndpointAddress  = WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service00000");
                OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);
                LWCFOperationReturn = LService00000Client.OperationMethodA(18, LListStrWcfArgs);
                if (LWCFOperationReturn.BoolReturn)
                {
                    IDataTable11009 = LWCFOperationReturn.DataSetReturn.Tables[0];
                    //全部翻译
                    foreach (DataRow dr in IDataTable11009.Rows)
                    {
                        dr["C006"] = DecryptString(dr["C006"].ToString());
                    }
                }
            }
            catch (Exception ex) { ShowExceptionMessage(ex.Message); }
            finally
            {
                if (LService00000Client != null)
                {
                    if (LService00000Client.State == CommunicationState.Opened)
                    {
                        LService00000Client.Close();
                    }
                }
            }
        }
Exemple #18
0
        protected override void InitLanguageInfos()
        {
            base.InitLanguageInfos();

            Service00000Client LService00000Client = null;
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            List <string>      LListStrWcfArgs     = new List <string>();

            try
            {
                IDataTableLanguage = new DataTable();

                LListStrWcfArgs.Add(Session.DatabaseInfo.TypeID.ToString());
                LListStrWcfArgs.Add(Session.DatabaseInfo.GetConnectionString());
                LListStrWcfArgs.Add(Session.LangTypeInfo.LangID.ToString());
                LListStrWcfArgs.Add("M22");
                LListStrWcfArgs.Add("11");
                LListStrWcfArgs.Add("1106");
                LBasicHttpBinding = WebHelper.CreateBasicHttpBinding(Session);
                LEndpointAddress  = WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service00000");
                OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);
                LWCFOperationReturn = LService00000Client.OperationMethodA(8, LListStrWcfArgs);
                if (LWCFOperationReturn.BoolReturn)
                {
                    IDataTableLanguage = LWCFOperationReturn.DataSetReturn.Tables[0];
                }
            }
            catch { }
            finally
            {
                if (LService00000Client != null)
                {
                    if (LService00000Client.State == CommunicationState.Opened)
                    {
                        LService00000Client.Close();
                    }
                }
            }
        }
Exemple #19
0
        //加载所有的参数的内容(从T_11_001里面获取)
        public void LoadSecurityPlicy()
        {
            Service00000Client LService00000Client = null;
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            List <string>      LListStrWcfArgs     = new List <string>();

            try
            {
                GDataTable11001 = new DataTable();

                LListStrWcfArgs.Add(Session.DatabaseInfo.TypeID.ToString());
                LListStrWcfArgs.Add(Session.DatabaseInfo.GetConnectionString());
                LListStrWcfArgs.Add(Session.RentInfo.Token);
                LBasicHttpBinding = WebHelper.CreateBasicHttpBinding(Session);
                LEndpointAddress  = WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service00000");
                OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);
                LWCFOperationReturn = LService00000Client.OperationMethodA(17, LListStrWcfArgs);
                if (LWCFOperationReturn.BoolReturn)
                {
                    GDataTable11001 = LWCFOperationReturn.DataSetReturn.Tables[0];
                    GDataTable00003 = LWCFOperationReturn.ListDataSetReturn[0].Tables[0];
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                if (LService00000Client != null)
                {
                    if (LService00000Client.State == CommunicationState.Opened)
                    {
                        LService00000Client.Close();
                    }
                }
            }
        }
Exemple #20
0
        /// <summary>
        /// 加载本应用程序的权限列表
        /// </summary>
        public static void LoadThidModuleOperation()
        {
            Service00000Client LService00000Client = null;
            BasicHttpBinding   LBasicHttpBinding   = null;
            EndpointAddress    LEndpointAddress    = null;
            List <string>      LListStrWcfArgs     = new List <string>();

            try
            {
                IDataTableOperation = new DataTable();

                LBasicHttpBinding = WebHelper.CreateBasicHttpBingding();
                LEndpointAddress  = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00000");
                OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);

                LListStrWcfArgs.Add(GClassSessionInfo.DatabaseInfo.TypeID.ToString());
                LListStrWcfArgs.Add(GClassSessionInfo.DatabaseInfo.GetConnectionString());
                LListStrWcfArgs.Add(GClassSessionInfo.RentInfo.Token);
                LListStrWcfArgs.Add(GClassSessionInfo.UserInfo.UserID.ToString());
                LListStrWcfArgs.Add(GClassSessionInfo.RoleInfo.ID.ToString());
                LListStrWcfArgs.Add("11");
                LWCFOperationReturn = LService00000Client.OperationMethodA(16, LListStrWcfArgs);
                if (LWCFOperationReturn.BoolReturn)
                {
                    IDataTableOperation = LWCFOperationReturn.DataSetReturn.Tables[0];
                }
            }
            catch { }
            finally
            {
                if (LService00000Client != null)
                {
                    if (LService00000Client.State == CommunicationState.Opened)
                    {
                        LService00000Client.Close();
                    }
                }
            }
        }
Exemple #21
0
        public static void LoadAboutAgentData()
        {
            Service00000Client LService00000Client     = null;
            BasicHttpBinding   LBasicHttpBinding       = null;
            EndpointAddress    LEndpointAddress        = null;
            List <string>      LListStrWcfArgs         = new List <string>();
            string             LStrVerificationCode104 = string.Empty;

            try
            {
                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);

                IDataTable11005   = new DataTable();
                IDataTable11006   = new DataTable();
                IDataTable11101   = new DataTable();
                IDataTable11009   = new DataTable();
                IDataTable11201SA = new DataTable();
                IDataTable11201UA = new DataTable();
                IDataTable11201UO = new DataTable();
                IDataTable11201UU = new DataTable();

                LListStrWcfArgs.Add(GClassSessionInfo.DatabaseInfo.TypeID.ToString());
                LListStrWcfArgs.Add(GClassSessionInfo.DatabaseInfo.GetConnectionString());
                LListStrWcfArgs.Add(GClassSessionInfo.RentInfo.Token);
                LListStrWcfArgs.Add(GClassSessionInfo.UserInfo.UserID.ToString());
                LBasicHttpBinding = WebHelper.CreateBasicHttpBinding();
                LEndpointAddress  = WebHelper.CreateEndpointAddress(App.GClassSessionInfo.AppServerInfo, "Service00000");
                OperationDataArgs LWCFOperationReturn = new OperationDataArgs();
                LService00000Client = new Service00000Client(LBasicHttpBinding, LEndpointAddress);
                LWCFOperationReturn = LService00000Client.OperationMethodA(26, LListStrWcfArgs);
                if (LWCFOperationReturn.BoolReturn)
                {
                    IDataTable11005   = LWCFOperationReturn.ListDataSetReturn[0].Tables[0];
                    IDataTable11006   = LWCFOperationReturn.ListDataSetReturn[1].Tables[0];
                    IDataTable11101   = LWCFOperationReturn.ListDataSetReturn[2].Tables[0];
                    IDataTable11009   = LWCFOperationReturn.ListDataSetReturn[3].Tables[0];
                    IDataTable11201SA = LWCFOperationReturn.ListDataSetReturn[4].Tables[0];
                    IDataTable11201UA = LWCFOperationReturn.ListDataSetReturn[5].Tables[0];
                    IDataTable11201UO = LWCFOperationReturn.ListDataSetReturn[6].Tables[0];
                    IDataTable11201UU = LWCFOperationReturn.ListDataSetReturn[7].Tables[0];

                    foreach (DataRow LDataRowSingleAgent in IDataTable11101.Rows)
                    {
                        if (LDataRowSingleAgent["C002"].ToString() != "1")
                        {
                            continue;
                        }
                        LDataRowSingleAgent["C017"] = EncryptionAndDecryption.EncryptDecryptString(LDataRowSingleAgent["C017"].ToString(), LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
            finally
            {
                if (LService00000Client != null)
                {
                    if (LService00000Client.State == CommunicationState.Opened)
                    {
                        LService00000Client.Close();
                    }
                }
            }
        }
        void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (!CheckInput())
            {
                return;
            }
            try
            {
                string strOldPass = TxtOldPassword.Password.Trim();
                string strNewPass = TxtNewPassword.Password.Trim();

                List <string> listArgs = new List <string>();
                listArgs.Add(CurrentApp.Session.RentInfo.Token);
                listArgs.Add(CurrentApp.Session.UserID.ToString());
                listArgs.Add(strOldPass);
                listArgs.Add(strNewPass);
                listArgs.Add(S1202App.LoginSessionID);

                for (int i = 0; i < listArgs.Count; i++)
                {
                    listArgs[i] = S1202App.EncryptString(listArgs[i]);
                }

                Service00000Client client = new Service00000Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service00000"));
                OperationDataArgs retArgs = client.OperationMethodA(14, listArgs);
                client.Close();
                string strReturn = retArgs.StringReturn;
                CurrentApp.WriteLog("ChangePassword", string.Format("Change password return: {0}", strReturn));
                if (!retArgs.BoolReturn)
                {
                    ShowException(CurrentApp.GetLanguageInfo("S0000039", "Change password fail."));
                    return;
                }
                strReturn = S1202App.DecryptString(strReturn);
                if (strReturn != "S01A01")
                {
                    #region 错误消息

                    //ShowException(CurrentApp.GetLanguageInfo("S0000039", "Change password fail."));
                    switch (strReturn)
                    {
                    case "W000E02":
                        ShowException(CurrentApp.GetLanguageInfo("S0000060", ""));
                        break;

                    case "W000E03":
                        ShowException(CurrentApp.GetLanguageInfo("S0000061", ""));
                        break;

                    case "W000E04":
                        ShowException(CurrentApp.GetLanguageInfo("S0000062", ""));
                        break;

                    case "W000E05":
                        ShowException(CurrentApp.GetLanguageInfo("S0000063", ""));
                        break;

                    case "W000E06":
                        ShowException(CurrentApp.GetLanguageInfo("S0000064", ""));
                        break;

                    case "W000E08":
                        ShowException(CurrentApp.GetLanguageInfo("S0000078", "Get password history fail."));
                        break;

                    case "W000E09":
                        ShowException(CurrentApp.GetLanguageInfo("S0000079", "Get security settings fail."));
                        break;

                    case "W000E10":
                        ShowException(CurrentApp.GetLanguageInfo("S0000080", "Save password to database fail."));
                        break;

                    case "W000E11":
                        ShowException(CurrentApp.GetLanguageInfo("S0000081", ""));
                        break;

                    case "W000E12":
                        ShowException(CurrentApp.GetLanguageInfo("S0000082", ""));
                        break;
                    }

                    #endregion

                    return;
                }
                MessageBox.Show(CurrentApp.GetLanguageInfo("S0000040", "Change password successful"), CurrentApp.AppTitle,
                                MessageBoxButton.OK, MessageBoxImage.Information);

                CurrentApp.Session.UserInfo.Password = S1202App.EncryptString(strNewPass);


                #region 通知密码修改

                try
                {
                    WebRequest webRequest = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)RequestCode.SCGlobalSettingChanged;
                    webRequest.ListData.Add(ConstValue.GS_KEY_PARAM_PASSWORD);
                    webRequest.ListData.Add(CurrentApp.Session.UserInfo.Password);
                    webRequest.ListData.Add(string.Empty);
                    CurrentApp.PublishEvent(webRequest);
                }
                catch (Exception ex)
                {
                    CurrentApp.WriteLog("ChangePassword",
                                        string.Format("Send change password notification fail.\t{0}", ex.Message));
                }

                #endregion


                mOptResult = RESULT_SUCC;
                if (PageParent != null)
                {
                    PageParent.OnChangePasswordResult(mOptResult);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Exemple #23
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;
                    }
                }
            }
        }
        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;
                    }
                }
            }
        }
Exemple #25
0
 void BtnConfirm_Click(object sender, RoutedEventArgs e)
 {
     labMessage.Content = "";
     if (string.IsNullOrWhiteSpace(pbOldPwd.Password))
     {
         labMessage.Content = App.GetLanguageInfo("3104T00104", "OldPassWord Is Null");
         return;
     }
     if (string.IsNullOrWhiteSpace(pbNewPwd1.Password) || string.IsNullOrWhiteSpace(pbNewPwd2.Password))//空密码
     {
         labMessage.Content = App.GetLanguageInfo("3104T00121", "Old Password Or New PassWord Is Null");
         return;
     }
     if (pbOldPwd.Password != App.Session.UserInfo.Password)
     {
         labMessage.Content = App.GetLanguageInfo("3104T00104", "Old PassWord is False,Please Write Correct  PassWord");
         return;
     }
     if (pbNewPwd1.Password != pbNewPwd2.Password)//两次输入的新密码不一致
     {
         labMessage.Content = App.GetLanguageInfo("3104T00122", "Two PassWord Is Not Consistent,Please Write Again");
         return;
     }
     if (App.renterID.Length != 5)
     {
         labMessage.Content = "RenterID Is Flase,Can't Change Password";
         return;
     }
     try
     {
         List <string> pwdString = new List <string>();
         pwdString.Add(App.Session.DBType.ToString());  //数据库类型
         pwdString.Add(App.Session.DBConnectionString); //数据库连接串
         pwdString.Add(App.renterID);                   //租户编码
         pwdString.Add(App.Session.UserID.ToString());  //用户编码
         pwdString.Add(pbOldPwd.Password);              //原密码
         pwdString.Add(pbNewPwd1.Password);             //新密码
         Service00000Client loginClient = new Service00000Client(WebHelper.CreateBasicHttpBinding(App.Session),
                                                                 WebHelper.CreateEndpointAddress(App.Session.AppServerInfo, "Service00000"));
         OperationDataArgs args = loginClient.OperationMethodA(44, pwdString);
         labMessage.Content = args.StringReturn;
         if (args.StringReturn == "")
         {
             App.ShowInfoMessage(App.GetLanguageInfo("3104T00093", string.Format("--Modify Sucessed")));
             App.Session.UserInfo.Password = pbNewPwd1.Password;
             App.PwdState = 999.00;
             var parent = Parent as PopupPanel;
             if (parent != null)
             {
                 parent.IsOpen = false;
             }
         }
         else if (args.StringReturn.Substring(0, 1) == "W")
         {
             int temp = Convert.ToInt32(args.StringReturn.Substring(6, 1)) + 3;
             App.ShowExceptionMessage(App.GetLanguageInfo(string.Format("3104T0010{0}", temp), args.StringReturn));
             return;
         }
     }
     catch (Exception ex)
     {
         App.WriteOperationLog("3104", ConstValue.OPT_RESULT_FAIL, Utils.FormatOptLogString("3104T00096"));
     }
     #region 写操作日志
     App.WriteOperationLog("3104", ConstValue.OPT_RESULT_SUCCESS, Utils.FormatOptLogString("3104T00096"));
     #endregion
 }