Exemplo n.º 1
0
        public ISO8583TranDay(Channel_Info channel)
        {
            logger                = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
            user_id               = channel.UserLogin;
            branch_id             = channel.Branch;
            retail_trancode       = channel.Retail_Trancode;
            fundtransfer_trancode = channel.FundTranfer_Trancode;
            transdate             = BaseParameters.ToDay().TransDate;
            string a = Validation();

            if (a != "")
            {
                if (logger.IsDebugEnabled)
                {
                    logger.Debug(a);
                }
                throw new Exception(a);
            }
            _channel = channel;
        }
Exemplo n.º 2
0
        public int Delete(string channelName)
        {
            if (string.IsNullOrEmpty(channelName))
            {
                SetError(98, "Channel name is null or empty");
                return(Error_Number);
            }
            Channel_Info obj = base.GetChannelByName(channelName);

            if (obj == null)
            {
                SetError(98, "Channel not find");
                return(Error_Number);
            }
            if (base.Delete(obj) != 0)
            {
                SetError(0, String.Empty);
            }
            else
            {
                SetError(99, Error_Message);
            }
            return(Error_Number);
        }
Exemplo n.º 3
0
        private Channel_Info GenerateObj(DataRow row)
        {
            if (row == null)
            {
                throw new Exception("Data row is empty or null");
            }
            Channel_Info channel = new Channel_Info();

            if (row["ID"] != DBNull.Value)
            {
                channel.ID = Convert.ToInt32(row["ID"]);
            }
            if (row["Name"] != DBNull.Value)
            {
                channel.Name = Convert.ToString(row["Name"]);
            }
            if (row["Descript"] != DBNull.Value)
            {
                channel.Descript = Convert.ToString(row["Descript"]);
            }
            if (row["Service_Port"] != DBNull.Value)
            {
                channel.Service_Port = Convert.ToInt32(row["Service_Port"]);
            }
            if (row["Iso_Port"] != DBNull.Value)
            {
                channel.ISO_Port = Convert.ToInt32(row["Iso_Port"]);
            }
            if (row["Listener_Host"] != DBNull.Value)
            {
                channel.Listener_Host = Convert.ToString(row["Listener_Host"]);
            }
            if (row["Categories"] != DBNull.Value)
            {
                channel.Categories = Convert.ToString(row["Categories"]);
            }
            if (row["Currency_Code"] != DBNull.Value)
            {
                channel.Currency_Code = Convert.ToString(row["Currency_Code"]);
            }
            if (row["User_ID"] != DBNull.Value)
            {
                channel.UserLogin = Convert.ToString(row["User_ID"]);
            }
            if (row["Branch_ID"] != DBNull.Value)
            {
                channel.Branch = Convert.ToString(row["Branch_ID"]);
            }
            if (row["Trancode_AddFund"] != DBNull.Value)
            {
                channel.AddFund_Trancode = Convert.ToString(row["Trancode_AddFund"]);
            }
            if (row["Trancode_Retail"] != DBNull.Value)
            {
                channel.Retail_Trancode = Convert.ToString(row["Trancode_Retail"]);
            }
            if (row["Trancode_Fund_Transfer"] != DBNull.Value)
            {
                channel.FundTranfer_Trancode = Convert.ToString(row["Trancode_Fund_Transfer"]);
            }
            if (row["CreateDated"] != DBNull.Value)
            {
                channel.Create_Date = Convert.ToDateTime(row["CreateDated"]);
            }
            if (row["Last_Date"] != DBNull.Value)
            {
                channel.Last_Date = Convert.ToDateTime(row["Last_Date"]);
            }
            if (row["UserCreate"] != DBNull.Value)
            {
                channel.User_Create = Convert.ToString(row["UserCreate"]);
            }
            if (row["Security"] != DBNull.Value)
            {
                channel.Security = Convert.ToBoolean(row["Security"]);
            }
            if (row["Private_Key"] != DBNull.Value)
            {
                channel.Key = Convert.ToString(row["Private_Key"]);
            }

            return(channel);
        }
Exemplo n.º 4
0
 public SqlCommand CreateOneChannel(Channel_Info objChannels_Info)
 {
     try
     {
         SqlCommand command = new SqlCommand(@"INSERT INTO Channels
                                 ([Name]
                                 ,[Descript]
                                 ,[Service_port]
                                 ,[Iso_port]
                                 ,[Listener_host]
                                 ,[Currency_Code]
                                 ,[Categories]
                                 ,[Branch_ID]
                                 ,[User_ID]
                                 ,[Trancode_AddFund]                                        
                                 ,[Trancode_Retail]
                                 ,[Trancode_Fund_Transfer]
                                 ,[Security]
                                 ,[Private_Key]
                                 ,[CreateDated]
                                 ,[Last_Date]
                                 ,[UserCreate])
                                 VALUES (@Name,
                                  @Descript,
                                  @Service_port,
                                  @Iso_port,
                                  @Listener_host,
                                  @Currency_code,
                                  @Categories,
                                  @Branch_ID,
                                  @User_ID,
                                  @Trancode_AddFund,
                                  @Trancode_Retail,
                                  @Trancode_Fund_Transfer,
                                  @Security,
                                  @Private_Key,
                                  @CreateDated,
                                  @Last_Date,
                                  @UserCreate)");
         command.CommandType = System.Data.CommandType.Text;
         command.Parameters.Clear();
         command.Parameters.Add("@Name", SqlDbType.NVarChar, 50).Value                  = objChannels_Info.Name;
         command.Parameters.Add("@Descript", SqlDbType.NVarChar, 250).Value             = objChannels_Info.Descript;
         command.Parameters.Add("@Service_port", SqlDbType.Int).Value                   = objChannels_Info.Service_Port;
         command.Parameters.Add("@Iso_port", SqlDbType.Int).Value                       = objChannels_Info.ISO_Port;
         command.Parameters.Add("@Listener_host", SqlDbType.NVarChar, 50).Value         = objChannels_Info.Listener_Host;
         command.Parameters.Add("@Currency_Code", SqlDbType.NVarChar, 3).Value          = objChannels_Info.Currency_Code;
         command.Parameters.Add("@Categories", SqlDbType.NVarChar, 25).Value            = objChannels_Info.Categories;
         command.Parameters.Add("@Branch_ID", SqlDbType.NVarChar, 25).Value             = objChannels_Info.Branch;
         command.Parameters.Add("@User_ID", SqlDbType.NVarChar, 25).Value               = objChannels_Info.UserLogin;
         command.Parameters.Add("@Trancode_Addfund", SqlDbType.NVarChar, 5).Value       = objChannels_Info.AddFund_Trancode;
         command.Parameters.Add("@Trancode_Retail", SqlDbType.NVarChar, 5).Value        = objChannels_Info.Retail_Trancode;
         command.Parameters.Add("@Trancode_Fund_Transfer", SqlDbType.NVarChar, 5).Value = objChannels_Info.FundTranfer_Trancode;
         command.Parameters.Add("@Security", SqlDbType.Bit).Value                       = objChannels_Info.Security;
         command.Parameters.Add("@Private_Key", SqlDbType.NVarChar, 4000).Value         = objChannels_Info.Key;
         command.Parameters.Add("@CreateDated", SqlDbType.DateTime).Value               = objChannels_Info.Create_Date;
         command.Parameters.Add("@Last_Date", SqlDbType.DateTime).Value                 = objChannels_Info.Last_Date;
         command.Parameters.Add("@UserCreate", SqlDbType.NVarChar, 25).Value            = objChannels_Info.User_Create;
         AddCommand(command);
         return(command);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 5
0
 public ServiceHostEnhanced(Channel_Info _channel)
 {
     channel = _channel;
     logger  = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
     //logger = LogManager.GetLogger("Account.Host");
 }
Exemplo n.º 6
0
        public new int Insert(Channel_Info obj)
        {
            if (obj == null)
            {
                SetError(98, "Invalid data input");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.Name))
            {
                SetError(98, "Channels name is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.Descript))
            {
                SetError(98, "Channels descript is null or empty");
                return(Error_Number);
            }
            if ((obj.Service_Port < 0) || (obj.Service_Port > 65535))
            {
                SetError(98, "Channels Service Port invalid \n Must be in range 0 to 65535");
                return(Error_Number);
            }
            if ((obj.ISO_Port < 0) || (obj.ISO_Port > 65535))
            {
                SetError(98, "Channels Iso Port invalid \n Must be in range 0 to 65535");
                return(Error_Number);
            }

            if (string.IsNullOrEmpty(obj.Listener_Host))
            {
                SetError(98, "Channels Listener Host is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.Currency_Code))
            {
                SetError(98, "Channels Currency Code is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.Categories))
            {
                SetError(98, "Channels categories Code is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.Branch))
            {
                SetError(98, "Channels branch Code is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.UserLogin))
            {
                SetError(98, "Channels user login is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.Retail_Trancode))
            {
                SetError(98, "Channels trancode retail is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.FundTranfer_Trancode))
            {
                SetError(98, "Channels trancode fundtransfer is null or empty");
                return(Error_Number);
            }
            if (obj.Create_Date == DateTime.MinValue)
            {
                SetError(98, "Channels createdate is null or empty");
                return(Error_Number);
            }
            if (obj.Last_Date == DateTime.MinValue)
            {
                SetError(98, "Channels lastUpdate is null or empty");
                return(Error_Number);
            }
            if (string.IsNullOrEmpty(obj.User_Create))
            {
                SetError(98, "Channels user create is null or empty");
                return(Error_Number);
            }
            if (base.Insert(obj) != 0)
            {
                SetError(0, string.Empty);
            }
            else
            {
                SetError(99, Error_Message);
            }
            return(Error_Number);
        }
Exemplo n.º 7
0
 public ChannelAccount(Channel_Info channel)
 {
     _channel = channel;
     logger   = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
 }
Exemplo n.º 8
0
 public ChannelCustomer(Channel_Info channel) : base()
 {
     _channel = channel;
     Logger   = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
 }