public int InsertPosBillPaymentData(POSBillPayment posBillPayment)
        {
            var jsonPayment        = JsonConvert.SerializeObject(posBillPayment);
            var httpContentPayment = new StringContent(jsonPayment, Encoding.UTF8, "application/json");
            var paymentResponse    = httpClient.PostAsync("api/posprocess/insertposbillpaymentsdata", httpContentPayment);

            if (paymentResponse.IsSuccessStatusCode)
            {
                return(paymentResponse.Content.ReadAsAsync <int>().Result);
            }
            return(0);
        }
Ejemplo n.º 2
0
 public IHttpActionResult InsertPOSBillPaymentsData(POSBillPayment posBillPayment)
 {
     try
     {
         int id = _iPOSProcessRepository.InsertPOSBillPaymentsData(posBillPayment);
         return(Ok(id));
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// This method used for insert into pos bill payment . -An
 /// </summary>
 /// <param name="posBillPayment">posBillPayment contain POSBillID,ParamTypeId,Amount,BankPOSTransNo</param>
 /// <returns></returns>
 public int InsertPOSBillPaymentsData(POSBillPayment posBillPayment)
 {
     try
     {
         posBillPayment.CreatedDateTime = DateTime.UtcNow;
         _posBillPaymentContext.Add(posBillPayment);
         _posBillPaymentContext.SaveChanges();
         return(posBillPayment.Id);
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }
Ejemplo n.º 4
0
 private void InsertPosBillPaymentData(int posBillId, POSBillPaymentType paymentTypeMode, string BankTranscationNumber, decimal amount)
 {
     try
     {
         POSBillPayment payment = new POSBillPayment();
         payment.POSBillID       = posBillId;
         payment.ParamTypeId     = (int)paymentTypeMode;
         payment.Amount          = amount;
         payment.BankPOSTransNo  = BankTranscationNumber;
         payment.CreatedDateTime = DateTime.UtcNow;
         _posRepository.InsertPosBillPaymentData(payment);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// This method used for insert POSBillPayment. -An
        /// </summary>
        /// <param name="posBillPayment"></param>
        /// <returns></returns>
        public int AddNewPOSBillPayment(POSBillPayment posBillPayment)
        {
            try
            {
                _POSBillPayment.Add(posBillPayment);
                _POSBillPayment.SaveChanges();
                var paramType = _paramTypeContext.FirstOrDefault(x => x.Id == posBillPayment.ParamTypeId);

                var posSession = _posSessionsContext.FirstOrDefault(x => x.POSLoginSessionId == posBillPayment.POSBill.POSSessionID);
                switch (paramType.ValueEn)
                {
                case StringConstants.Cash:
                    posSession.Cash += posBillPayment.Amount;
                    break;

                case StringConstants.DebitCard:
                    posSession.DebitCard += posBillPayment.Amount;
                    break;

                case StringConstants.CreditCardPOS:
                    posSession.CreditCard += posBillPayment.Amount;
                    break;

                case StringConstants.Coupon:
                    posSession.Coupon += posBillPayment.Amount;
                    break;

                case StringConstants.Cheque:
                    posSession.Cheque += posBillPayment.Amount;
                    break;

                default:
                    break;
                }
                posSession.ModifiedDateTime = DateTime.UtcNow;
                _posSessionsContext.Update(posSession);
                _posSessionsContext.SaveChanges();
                return(posBillPayment.Id);
            }
            catch (Exception ex)
            {
                _errorLog.LogException(ex);
                throw;
            }
        }
 public int InsertPosBillPaymentData(POSBillPayment posBillPayment)
 {
     _posBillPayment.Add(posBillPayment);
     _posBillPayment.SaveChanges();
     return(posBillPayment.Id);
 }