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; }
public void SaveUpdatePayment(PaymentToSupplier model) { if (model.Id > 0) { this._paymentToSupplierProvider.Update(model); } else { this._paymentToSupplierProvider.Insert(model); } }
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); }
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); } }
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); } }
public void DeletePayment(PaymentToSupplier payment) { _paymentToSupplierProvider.Delete(payment); }
/// <summary> /// There are no comments for PaymentToSupplier in the schema. /// </summary> public void AddToPaymentToSupplier(PaymentToSupplier paymentToSupplier) { base.AddObject("PaymentToSupplier", paymentToSupplier); }
/// <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; }