Exemplo n.º 1
0
 public void insertRequisitionDetailsGF(RequisitionDetailsGF red)
 {
     var req = ctx.requisitions.FirstOrDefault(o => o.requisitionId == red.RequisitionId);
     requisitionDetail newred = new requisitionDetail();
     newred.requisitionId = red.RequisitionId;
     newred.itemId = red.ItemId;
     newred.requestedQty = red.RequesetedQty;
     newred.deliveredQty = red.DeliveredQty;
        // newred.status = red.Status;
     req.requisitionDetails.Add(newred);
     ctx.SaveChanges();
     //gaofan
 }
Exemplo n.º 2
0
 public void insertRequisitionDetails(RequisitionDetailsGF red)
 {
     requisitiongf.insertRequisitionDetailsGF(red);
 }
Exemplo n.º 3
0
        public List<RequisitionDetailsGF> getRequisitionDetailsByRequisitionIdGF(string requisitionId)
        {
            var item = from x in ctx.requisitionDetails
                       where x.requisitionId == requisitionId
                       select new
                       {
                           requsitionId = x.requisitionId,
                           itemId = x.itemId,
                           requestedQty = x.requestedQty,
                           deliveredQty = x.deliveredQty,
                           //status = x.status,
                           itemName = x.item.description
                       };

            List<RequisitionDetailsGF> list = new List<RequisitionDetailsGF>();
            foreach (var a in item)
            {
                RequisitionDetailsGF red = new RequisitionDetailsGF();
                red.RequisitionId = a.requsitionId;
                red.ItemId = a.itemId;
                red.RequesetedQty = Convert.ToInt32(a.requestedQty);
                red.DeliveredQty = Convert.ToInt32(a.deliveredQty);
               // red.Status = a.status;
                red.ItemName = a.itemName;
                list.Add(red);
            }
            return list;
            //gaofan
        }