コード例 #1
0
        public static tblConnector ConvertDTOToTable(ConnectorDTO _dtoConnector)
        {
            tblConnector _tblConnector = new tblConnector();

            _tblConnector.ID = _dtoConnector.ConnectionID;
            _tblConnector.Connection_Name = _dtoConnector.ConnectionName;
            _tblConnector.User_Name       = StringEncryDecry.Encrypt(_dtoConnector.ServerUserName, _dtoConnector.SessionId);
            _tblConnector.Password        = StringEncryDecry.Encrypt(_dtoConnector.ServerPassword, _dtoConnector.SessionId);
            _tblConnector.Server_Name     = StringEncryDecry.Encrypt(_dtoConnector.ServerOrIP, _dtoConnector.SessionId);
            _tblConnector.Port_Number     = _dtoConnector.PortNumber;
            _tblConnector.Data_Connector_Connection_Type = _dtoConnector.DataConnectorType.ToString();
            _tblConnector.Gateway_Type = _dtoConnector.DataConnectorType.ToString();
            _tblConnector.Is_Active    = _dtoConnector.IsActive;

            _tblConnector.SessionID = _dtoConnector.SessionId;

            _tblConnector.Database_Name = _dtoConnector.DatabaseName;

            _tblConnector.Default_Path = _dtoConnector.DefaultPath;
            if (_dtoConnector.Mode != null)
            {
                _tblConnector.FTP_Mode = _dtoConnector.Mode.ToString();
            }


            return(_tblConnector);
        }
コード例 #2
0
        public static ConnectorDTO ConvertTableToDTO(tblConnector _tblConnector)
        {
            ConnectorDTO _dtoConnector = new ConnectorDTO();

            _dtoConnector.ConnectionID      = _tblConnector.ID;
            _dtoConnector.ConnectionName    = _tblConnector.Connection_Name;
            _dtoConnector.ServerUserName    = StringEncryDecry.Decrypt(_tblConnector.User_Name, _tblConnector.SessionID);
            _dtoConnector.ServerPassword    = StringEncryDecry.Decrypt(_tblConnector.Password, _tblConnector.SessionID);
            _dtoConnector.ServerOrIP        = StringEncryDecry.Decrypt(_tblConnector.Server_Name, _tblConnector.SessionID);
            _dtoConnector.PortNumber        = _tblConnector.Port_Number;
            _dtoConnector.DataConnectorType = (DataSouceConnectionType)Enums.TryParse(typeof(DataSouceConnectionType), _tblConnector.Data_Connector_Connection_Type.ToString());
            _dtoConnector.GatewayType       = (DataGatewayType)Enums.TryParse(typeof(DataGatewayType), _tblConnector.Gateway_Type.ToString());
            _dtoConnector.IsActive          = _tblConnector.Is_Active;

            _dtoConnector.SessionId = _tblConnector.SessionID;

            _dtoConnector.DatabaseName = _tblConnector.Database_Name;

            _dtoConnector.DefaultPath = _tblConnector.Default_Path;
            if (_tblConnector.FTP_Mode != null)
            {
                _dtoConnector.Mode = (FTPMode)Enums.TryParse(typeof(FTPMode), _tblConnector.FTP_Mode);
            }

            return(_dtoConnector);
        }
コード例 #3
0
        public static ExistingConnectionNameDTO ConvertTableToDTO(ConnectorDTO _dtoConnector)
        {
            ExistingConnectionNameDTO _dtoExistingConnection = new ExistingConnectionNameDTO();

            _dtoExistingConnection.ConnectionID      = _dtoConnector.ConnectionID;
            _dtoExistingConnection.ConnectionName    = _dtoConnector.ConnectionName;
            _dtoExistingConnection.DataConnectorType = (DataSouceConnectionType)Enums.TryParse(typeof(DataSouceConnectionType), _dtoConnector.DataConnectorType.ToString());
            _dtoExistingConnection.IsActive          = _dtoConnector.IsActive;
            return(_dtoExistingConnection);
        }