Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
 public PurchaseOrderLineStatus Add(PurchaseOrderLineStatus pt)
 {
     _unitOfWork.Repository <PurchaseOrderLineStatus>().Insert(pt);
     return(pt);
 }
Пример #4
0
 public void Update(PurchaseOrderLineStatus pt)
 {
     pt.ObjectState = ObjectState.Modified;
     _unitOfWork.Repository <PurchaseOrderLineStatus>().Update(pt);
 }
Пример #5
0
 public void Delete(PurchaseOrderLineStatus pt)
 {
     _unitOfWork.Repository <PurchaseOrderLineStatus>().Delete(pt);
 }
Пример #6
0
 public PurchaseOrderLineStatus Create(PurchaseOrderLineStatus pt)
 {
     pt.ObjectState = ObjectState.Added;
     _unitOfWork.Repository <PurchaseOrderLineStatus>().Insert(pt);
     return(pt);
 }
Пример #7
0
        public void DeleteLineStatus(int id)
        {
            PurchaseOrderLineStatus Stat = Find(id);

            Delete(Stat);
        }