public MomoTransaction GetMomoTransactionByRefNo(string ref_number)
        {
            using (var command = new SqlCommand())
            {
                command.CommandText = "usp_Get_Momo_Transaction_RefNo";
                command.Parameters.AddWithValue("@refNo", ref_number);

                var dt = GetData(command);

                if (dt != null && dt.Rows.Count > 0)
                {
                    var r = dt.Rows[0];

                    var transaction = new MomoTransaction
                    {
                        EntryID     = (int)r["EntryID"],
                        RefNo       = r["RefNo"].ToString(),
                        Amount      = Convert.ToDecimal(r["Amount"]),
                        MomoNumber  = r["MomoNumber"].ToString(),
                        MNO         = r["MNO"].ToString(),
                        LastUpdated = r["LastUpdated"].ToString()
                    };
                    return(transaction);
                }

                return(null);
            }
        }
        //Add or Post Transactions
        public string PostMomoTransaction(MomoTransaction transaction)
        {
            string msg = "";

            try
            {
                var last_accessed = DateTime.Now;
                using (var command = new SqlCommand())
                {
                    command.CommandText = "[usp_Momo_LoanRepayment]";

                    command.Parameters.AddWithValue("@RefNo ", transaction.RefNo);
                    command.Parameters.AddWithValue("@MomoNumber ", transaction.MomoNumber);
                    command.Parameters.AddWithValue("@MNO ", transaction.MNO);
                    command.Parameters.AddWithValue("@Amount", transaction.Amount);
                    command.Parameters.AddWithValue("@TransactionID", transaction.TransactionID);

                    var result = Save(command);

                    msg = result;
                }
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }
            return(msg);
        }
        internal void LogTransaction(MomoTransaction transaction, string message = "")
        {
            string msg = "";

            try
            {
                var last_accessed = DateTime.Now;
                using (var command = new SqlCommand())
                {
                    command.CommandText = "[usp_SaveTransactionLog]";

                    command.Parameters.AddWithValue("@RefNo ", transaction.RefNo);
                    command.Parameters.AddWithValue("@MomoNumber ", transaction.MomoNumber);
                    command.Parameters.AddWithValue("@MNO ", transaction.MNO);
                    command.Parameters.AddWithValue("@Amount", transaction.Amount);
                    command.Parameters.AddWithValue("@TransactionID", transaction.TransactionID);
                    command.Parameters.AddWithValue("@ResponseMsg", message);

                    var result = Save(command);

                    msg = result;
                }
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }
        }