Esempio n. 1
0
 public static bool insertPaymentToSupplier(APCEntities APCContext, SupplierInvoice supplierInvoice, decimal paymentAmount, DateTime paymentDate)
 {
     PaymentToSupplier paymentToSupplier = new PaymentToSupplier();
     paymentToSupplier.SupplierInvoice = supplierInvoice;
     paymentToSupplier.PaymentAmount = paymentAmount;
     paymentToSupplier.PaymentDate = paymentDate;
     APCContext.AddToPaymentToSupplier(paymentToSupplier);
     APCContext.SaveChanges();
     return true;
 }
Esempio n. 2
0
 public void SaveUpdatePayment(PaymentToSupplier model)
 {
     if (model.Id > 0)
     {
         this._paymentToSupplierProvider.Update(model);
     }
     else
     {
         this._paymentToSupplierProvider.Insert(model);
     }
 }
Esempio n. 3
0
        public static bool insertPaymentToSupplier(APCEntities APCContext, SupplierInvoice supplierInvoice, decimal paymentAmount, DateTime paymentDate)
        {
            PaymentToSupplier paymentToSupplier = new PaymentToSupplier();

            paymentToSupplier.SupplierInvoice = supplierInvoice;
            paymentToSupplier.PaymentAmount   = paymentAmount;
            paymentToSupplier.PaymentDate     = paymentDate;
            APCContext.AddToPaymentToSupplier(paymentToSupplier);
            APCContext.SaveChanges();
            return(true);
        }
Esempio n. 4
0
 public void DeletePayment(int id)
 {
     try
     {
         PaymentToSupplier payment = new PaymentToSupplier();
         payment = _supplierRepository.GetPaymentById(id);
         _supplierRepository.DeletePayment(payment);
     }
     catch (Exception ex)
     {
         fault.Result       = false;
         fault.ErrorMessage = "Error in DeletePayment method";
         fault.ErrorDetails = ex.ToString();
         throw new FaultException <FaultData>(fault);
     }
 }
Esempio n. 5
0
 public void SaveUpdatePayment(PaymentToSupplierModel model)
 {
     try
     {
         if (model.PaymentTosupplierId > 0)
         {
             var obj = _supplierRepository.GetPaymentsByCompanyIdAndBranchId(model.CompanyCode, model.BranchCode).FirstOrDefault(x => x.Id == model.PaymentTosupplierId);
             obj.AccountNo    = model.AccountNo;
             obj.Amount       = model.Amount;
             obj.BankName     = model.BankName;
             obj.CompanyCode  = obj.CompanyCode;
             obj.BranchCode   = obj.BranchCode;
             obj.CreatedBy    = obj.CreatedBy;
             obj.CreatedDate  = obj.CreatedDate;
             obj.Description  = model.Description;
             obj.InvoiceNo    = model.InvoiceNo;
             obj.ModifiedBy   = model.ModifiedBy;
             obj.ModifiedDate = CommonFunctions.ParseDateToFinclaveString(DateTime.Now.ToShortDateString());
             obj.PaymentDate  = model.PaymentDate;
             obj.PaymentType  = model.PaymentType;
             obj.SupplierCode = model.SupplierCode;
             obj.Id           = obj.Id;
             obj.PurchaseType = model.PurchaseType;
             //obj = new CompanyData(model.Id, model.Code.Value, model.Name, model.Description, model.PhoneNo, model.Logo, model.IsDefault, true, model.CreatedDate, model.UpdatedDate, model.ModifiedBy, model.CreatedBy);
             _supplierRepository.SaveUpdatePayment(obj);
         }
         else
         {
             PaymentToSupplier newModel = new PaymentToSupplier(model.PaymentTosupplierId, model.SupplierCode, model.Amount, model.PaymentDate, model.Description, model.InvoiceNo, model.AccountNo, model.CreatedBy, model.CreatedDate, model.ModifiedBy, model.ModifiedDate, model.PaymentType, model.BankName, model.CompanyCode, model.BranchCode, model.PurchaseType);
             _supplierRepository.SaveUpdatePayment(newModel);
         }
     }
     catch (Exception ex)
     {
         fault.Result       = false;
         fault.ErrorMessage = "Error in SaveUpdateSupplier method";
         fault.ErrorDetails = ex.ToString();
         throw new FaultException <FaultData>(fault);
     }
 }
Esempio n. 6
0
 public void DeletePayment(PaymentToSupplier payment)
 {
     _paymentToSupplierProvider.Delete(payment);
 }
Esempio n. 7
0
 /// <summary>
 /// There are no comments for PaymentToSupplier in the schema.
 /// </summary>
 public void AddToPaymentToSupplier(PaymentToSupplier paymentToSupplier)
 {
     base.AddObject("PaymentToSupplier", paymentToSupplier);
 }
Esempio n. 8
0
 /// <summary>
 /// Create a new PaymentToSupplier object.
 /// </summary>
 /// <param name="id">Initial value of Id.</param>
 public static PaymentToSupplier CreatePaymentToSupplier(int id)
 {
     PaymentToSupplier paymentToSupplier = new PaymentToSupplier();
     paymentToSupplier.Id = id;
     return paymentToSupplier;
 }