Exemple #1
0
        public static decimal?GetBalanceStoreSpaceByBinNo(string WarehouseCode, string BinNo)
        {
            var     connection        = ApiService.dbConnection;
            decimal?balanceStoreSpace = null;
            decimal?whStoreSpace      = null;
            whwh2   myWhDetail        = WarehouseHelper.GetWarehouseDetail(WarehouseCode, BinNo);

            whStoreSpace = myWhDetail.StoreSpace;

            decimal invStoreSpace = 0;

            try
            {
                connection.Open();
                invStoreSpace = connection.ExecuteScalar <decimal>(qryInventory.selectInvStoreSpaceByBin, new { WarehouseCode, BinNo });
            }
            catch (Exception) { throw; }
            finally { connection.Close(); }

            if (whStoreSpace.HasValue)
            {
                balanceStoreSpace = whStoreSpace - invStoreSpace;
            }

            return(balanceStoreSpace);
        }
Exemple #2
0
        public IHttpActionResult GenerateBinNos([FromBody] dynamic StoregeLayout)
        {
            List <string> BinList = WarehouseHelper.GenerateBinNo(StoregeLayout);

            if (BinList == null)
            {
                return(BadRequest());
            }
            return(Ok(BinList));
        }
Exemple #3
0
        public IHttpActionResult DeleteWarehouse(string WarehouseCode, int Type)
        {
            int afRowCnt = WarehouseHelper.DeleteWarehouse(WarehouseCode, Type);

            if (afRowCnt == 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }
Exemple #4
0
        public IHttpActionResult GetWarehouse(string WarehouseCode)
        {
            var whwh1 = WarehouseHelper.GetWarehouse(WarehouseCode);
            var whwh2 = WarehouseHelper.GetWarehouseDetails(WarehouseCode);

            if (whwh1 == null)
            {
                return(BadRequest());
            }
            var data = new { whwh1, whwh2 };

            return(Ok(data));
        }
Exemple #5
0
        public IHttpActionResult SaveWarehouse(dynamic data)
        {
            JObject whwh1 = data.whwh1;
            var     myWh  = JsonConvert.DeserializeObject <whwh1>(whwh1.ToString());

            JArray whwh2       = data.whwh2;
            var    myWhDetails = JsonConvert.DeserializeObject <List <whwh2> >(whwh2.ToString());

            int afRowCnt = WarehouseHelper.SaveWarehouse(myWh);

            if (myWhDetails.Count > 0)
            {
                afRowCnt += WarehouseHelper.SaveWarehouseDetails(myWhDetails);
            }

            if (afRowCnt == 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }