public void approveAdjustmentItem(int adjustmentId, int itemId)
        {
            StockAdjustmentItem item = db.StockAdjustmentItems.Where(x => x.StockAdjustmentID == adjustmentId && x.ItemID == itemId).FirstOrDefault();

            item.Status = AdjustmentStatus.Approved.ToString();
            db.StockAdjustmentItems.Attach(item);
            var entry = db.Entry(item);

            entry.Property(e => e.Status).IsModified = true;
            db.SaveChanges();
        }
示例#2
0
        public void approveRequisition(int reqId, String remark)
        {
            Requisition requisition = db.Requisitions.Find(reqId);

            requisition.Status       = RequisitionStatus.Approved.ToString();
            requisition.Remark       = remark;
            requisition.ApprovedDate = DateTime.Now;
            db.Requisitions.Attach(requisition);
            var entry = db.Entry(requisition);

            entry.Property(e => e.Status).IsModified       = true;
            entry.Property(e => e.Remark).IsModified       = true;
            entry.Property(e => e.ApprovedDate).IsModified = true;
            db.SaveChanges();
        }
        public void updateRequisitionItem(int reqId, int itemId, int qty)
        {
            RequisitionItem item = db.RequisitionItems.Where(s => s.ReqID == reqId && s.SupplierItemID == itemId).First();

            if (item != null)
            {
                item.NeededQuantity = qty;
                db.RequisitionItems.Attach(item);
                var entry = db.Entry(item);
                entry.Property(e => e.NeededQuantity).IsModified = true;
                db.SaveChanges();
            }
        }