コード例 #1
0
 internal static bool AddNew(Transaction entity)
 {
     MoneyPacificBlackBoxDataContext db = Connection.Instance;
     db.Transactions.InsertOnSubmit(entity);
     db.SubmitChanges();
     return true;
 }
コード例 #2
0
        internal bool CheckIsPossible(string codeNumber)
        {
            Transaction newTransaction = new Transaction();
            
            bool result = GeneratorPacificCode.Generator.isPossibleCode(codeNumber);

            newTransaction.Origine = "Check Possible";
            newTransaction.Comment = "Check Possible: " + codeNumber;
            newTransaction.IsSuccessful = result;

            this._transactionBUS.AddNew(newTransaction);
            return result;
        }
コード例 #3
0
        internal PacificCode GetNewPacificCode(int amount)
        {
            
            Transaction newTransaction = new Transaction();            
            PacificCode pacificCode = this._pacificCodeBUS.GetNewPacificCode(amount);

            // Lấy thông tin Transaction
            newTransaction.Amount = pacificCode.ActualAmount;
            newTransaction.CreateDate = pacificCode.CreateDate;
            newTransaction.Origine = "BuyMP";
            newTransaction.PacificCodeId = pacificCode.Id;            
            newTransaction.Comment = string.Format("Buy: {0}", pacificCode.ActualAmount);
            newTransaction.IsSuccessful = true; 
            // Luôn luôn cho phép tạo thành công...

            // Lưu
            this._transactionBUS.AddNew(newTransaction);

            // Trả kết quả
            return pacificCode;
        }
コード例 #4
0
        internal PacificCodeViewModel[] GetArrayPacificCodeViewModel(string[] arrPartCodeNumber)
        {
            PacificCodeViewModel[] arrResult;

            arrResult = PacificCodeBUS.GetArray(arrPartCodeNumber);


            Transaction newTransaction = new Transaction();
            // BEGIN --            
            newTransaction.Origine = "GetArrayPacificCodeViewModel";
            newTransaction.Comment = string.Format("Get PacificCodeViewModel: array");
            // END --
            // this._transactionBUS.AddNew(newTransaction);

            return arrResult;
            
        }
コード例 #5
0
        internal PacificCodeViewModel GetPacificCodeViewModel(string partCodeNumber)
        {
            Transaction newTransaction = new Transaction();
            PacificCodeViewModel model = new PacificCodeViewModel();
            PacificCode pacificCode = PacificCodeBUS.GetObject(partCodeNumber);

            if (pacificCode != null)
            {
                model.SetAttritebuteValue(pacificCode);

                // BEGIN --            
                newTransaction.Origine = "GetPacificCodeViewModel";
                newTransaction.Comment = string.Format("Get PacificCodeViewModel: {0}"
                    , partCodeNumber);
                // END --

                // Hien tai chưa can luu Transaction loại này
                // this._transactionBUS.AddNew(newTransaction);

                return model;
            }
            
            return null;
        }
コード例 #6
0
        internal bool CheckIsExistPartCodeNumber(string partCodeNumber)
        {
            Transaction newTransaction = new Transaction();
            bool result = PacificCodeBUS.IsExistPartCodeNumber(partCodeNumber);

            // BEGIN --            
            newTransaction.Origine = "Check Exist Part";
            newTransaction.Comment = string.Format("Check Exist Part: {0}"
                , partCodeNumber);
            // END --

            // Hien tai chưa can luu Transaction loại này
            // this._transactionBUS.AddNew(newTransaction);

            return result;
        }
コード例 #7
0
        internal string ChangeCode(string codeNumber)
        {
            Transaction newTransaction = new Transaction();
            string newCodeNumber = this._pacificCodeBUS.ChangeCode(codeNumber);

            // BEGIN --            
            newTransaction.Origine = "ChangeCode";
            newTransaction.Comment = string.Format("ChangeCode: {0} to {1}"
                , codeNumber
                , newCodeNumber);
            // END --

            // Hien tai chưa can luu Transaction loại này
            this._transactionBUS.AddNew(newTransaction);
            return newCodeNumber;
        }
コード例 #8
0
        internal DateTime GetExpireDate(string partCodeNumber)
        {
            Transaction newTransaction = new Transaction();

            DateTime result = this._pacificCodeBUS.GetExpireDate(partCodeNumber);

            // Không nên lưu transaction loại này...
            // BEGIN --            
            newTransaction.Origine = "GetExpireDate";
            newTransaction.Comment = "Get ExpireDate(HeThong su dung): " + partCodeNumber;
            // END --

            this._transactionBUS.AddNew(newTransaction);
            return result;
        }
コード例 #9
0
        internal double GetInitialAmount(string partCodeNumber)
        {
            Transaction newTransaction = new Transaction();
            double result = this._pacificCodeBUS.GetInitialAmount(partCodeNumber);

            newTransaction.Origine = "GetInitialAmount";
            newTransaction.Comment = "Get Initial Amount: " + partCodeNumber;

            this._transactionBUS.AddNew(newTransaction);
            return result;
        }
コード例 #10
0
 internal PacificCode MakePayment(string codeNumber, int amount)
 {
     Transaction newTransaction = new Transaction();
     
     PacificCode pacificCode = this._pacificCodeBUS.MakePayment(codeNumber, amount);
     
     
     // BEGIN --            
     newTransaction.Origine = "MakePayment";
     newTransaction.PacificCodeId = pacificCode.Id;
     newTransaction.Comment = string.Format("Payment: {0} - {1}"
         ,codeNumber
         ,amount);
     newTransaction.IsSuccessful = true;
     // END --
     
     this._transactionBUS.AddNew(newTransaction);
     return pacificCode;
 }
コード例 #11
0
 internal static bool Update(Transaction entity)
 {
     // TODO:(không sử dụng)
     throw new NotImplementedException();
 }
コード例 #12
0
		private void detach_Transactions(Transaction entity)
		{
			this.SendPropertyChanging();
			entity.PacificCode = null;
		}
コード例 #13
0
 partial void DeleteTransaction(Transaction instance);
コード例 #14
0
 partial void UpdateTransaction(Transaction instance);
コード例 #15
0
 partial void InsertTransaction(Transaction instance);
コード例 #16
0
        internal double GetValue(string partCodeNumber)
        {
            Transaction newTransaction = new Transaction();
            
            double result = this._pacificCodeBUS.GetValue(partCodeNumber);
            
            // BEGIN --            
            newTransaction.Origine = "GetValue";
            newTransaction.Comment = "Check Value: " + partCodeNumber;
            // END --

            this._transactionBUS.AddNew(newTransaction); 
            return result;
        }
コード例 #17
0
        /// <summary>
        /// Phương thức này chỉ dùng tạm thời
        /// Cần thiết kế theo cách sau:
        /// - thanh toán xong trả ra Id Transaction
        /// - có 1 phuong thuc khác, cho phép kiểm tra Id Transaction đó có 
        /// thành công hay không
        /// </summary>
        /// <param name="codeNumber">CodeNumber sẽ bị trừ tiền</param>
        /// <param name="partCodeNumber">CodeNumber nhận tiền</param>
        /// <param name="amount">Số tiền thanh toán</param>
        /// <returns></returns>
        internal bool Tranfer(string codeNumber, string partCodeNumber, int amount)
        {
            /// TODO:
            Transaction newTransaction = new Transaction();            
            bool result = this._pacificCodeBUS.Tranfer(codeNumber, partCodeNumber, amount);

            newTransaction.Origine = "Make Payment";            
            newTransaction.Comment = string.Format("Make payment: {0} to {1} with amount: {2}"
                , codeNumber
                , partCodeNumber
                , amount);
            newTransaction.IsSuccessful = result;
            this._transactionBUS.AddNew(newTransaction);
            
            return result;
        }
コード例 #18
0
 internal void AddNew(Transaction entity)
 {
     TransactionDAO.AddNew(entity);
 }