Esempio n. 1
0
        public bool Update(ApiBatch apiBatch)
        {
            IBatchManager batchManager = UnityResolver.Resolve <IBatchManager>();
            Batch         batch        = new Batch
            {
                ID         = apiBatch.ID,
                Date       = apiBatch.Date,
                Qty        = apiBatch.Qty,
                UnitPrice  = apiBatch.UnitPrice,
                ItemID     = apiBatch.ItemID,
                SupplierID = apiBatch.SupplierID,
                CustomerID = apiBatch.CustomerID
            };

            return(batchManager.UpdateBatch(batch));
        }
Esempio n. 2
0
        public bool Update(ApiBatch apiBatch)
        {
            //string id = User.Identity.Name;
            IBatchManager batchManager = UnityResolver.Resolve <IBatchManager>();
            Batch         batch        = new Batch
            {
                ID         = apiBatch.ID,
                Date       = apiBatch.Date,
                Qty        = apiBatch.Qty,
                UnitPrice  = apiBatch.UnitPrice,
                ItemID     = apiBatch.ItemID,
                SupplierID = apiBatch.SupplierID,
                CustomerID = Helper.getCustID()
            };

            return(batchManager.UpdateBatch(batch));
        }
Esempio n. 3
0
        public ApiBatch Get(int ID)
        {
            IBatchManager batchManager = UnityResolver.Resolve <IBatchManager>();
            Batch         batchModel   = batchManager.FindBatchByID(ID);

            string   id    = User.Identity.Name;
            ApiBatch batch = new ApiBatch
            {
                ID         = batchModel.ID,
                Date       = batchModel.Date,
                Qty        = batchModel.Qty,
                UnitPrice  = batchModel.UnitPrice,
                ItemID     = batchModel.ItemID,
                SupplierID = batchModel.SupplierID
            };

            return(batch);
        }
Esempio n. 4
0
        public List <ApiBatch> GetList()
        {
            string          id             = User.Identity.Name;
            IBatchManager   batchManager   = UnityResolver.Resolve <IBatchManager>();
            List <Batch>    batchModelList = batchManager.GetAllBatches();
            List <ApiBatch> batchList      = new List <ApiBatch>();

            foreach (Batch batchModel in batchModelList)
            {
                ApiBatch batch = new ApiBatch
                {
                    ID         = batchModel.ID,
                    Date       = batchModel.Date,
                    Qty        = batchModel.Qty,
                    UnitPrice  = batchModel.UnitPrice,
                    ItemID     = batchModel.ItemID,
                    SupplierID = batchModel.SupplierID
                };

                batchList.Add(batch);
            }

            return(batchList);
        }