public void UpdateStatusQty(string QtyType, decimal Qty, DateTime date, int Id, ref ApplicationDbContext Context, bool IsDbBased) { PurchaseOrderLineStatus Stat = Find(Id); switch (QtyType) { case PurchaseStatusQtyConstants.CancelQty: { Stat.CancelQty = Qty; Stat.CancelDate = date; break; } case PurchaseStatusQtyConstants.ReceiveQty: { Stat.ReceiveQty = Qty; Stat.ReceiveDate = date; break; } case PurchaseStatusQtyConstants.InvoiceQty: { Stat.InvoiceQty = Qty; Stat.InvoiceDate = date; break; } case PurchaseStatusQtyConstants.ReturnQty: { Stat.ReturnQty = Qty; Stat.ReturnDate = date; break; } case JobStatusQtyConstants.AmendmentRate: { Stat.RateAmendmentRate = Qty; Stat.RateAmendmentDate = date; break; } default: { break; } } Stat.ObjectState = Model.ObjectState.Modified; if (IsDbBased) { Context.PurchaseOrderLineStatus.Add(Stat); } else { Update(Stat); } }
public void CreateLineStatus(int id, ref ApplicationDbContext Context) { PurchaseOrderLineStatus Stat = new PurchaseOrderLineStatus(); Stat.PurchaseOrderLineId = id; Stat.ObjectState = Model.ObjectState.Added; Context.PurchaseOrderLineStatus.Add(Stat); //Add(Stat); }
public PurchaseOrderLineStatus Add(PurchaseOrderLineStatus pt) { _unitOfWork.Repository <PurchaseOrderLineStatus>().Insert(pt); return(pt); }
public void Update(PurchaseOrderLineStatus pt) { pt.ObjectState = ObjectState.Modified; _unitOfWork.Repository <PurchaseOrderLineStatus>().Update(pt); }
public void Delete(PurchaseOrderLineStatus pt) { _unitOfWork.Repository <PurchaseOrderLineStatus>().Delete(pt); }
public PurchaseOrderLineStatus Create(PurchaseOrderLineStatus pt) { pt.ObjectState = ObjectState.Added; _unitOfWork.Repository <PurchaseOrderLineStatus>().Insert(pt); return(pt); }
public void DeleteLineStatus(int id) { PurchaseOrderLineStatus Stat = Find(id); Delete(Stat); }