示例#1
0
        public IHttpActionResult SaveGrn(whgr1 Grn)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            int trxNo = GrnHelper.SaveGrn(Grn);

            if (trxNo <= 0)
            {
                return(InternalServerError());
            }
            return(Ok(trxNo));
        }
示例#2
0
        public IHttpActionResult GetStatusCode(int TrxNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            whgr1 myGrn = GrnHelper.GetGrn(TrxNo);

            if (myGrn == null)
            {
                return(InternalServerError());
            }
            return(Ok(myGrn.StatusCode));
        }
示例#3
0
        public IHttpActionResult GetNewGrnNo(DateTime ReceiptDate)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            string newGrnNo = GrnHelper.GetNewGrnNo(ReceiptDate);

            if (string.IsNullOrEmpty(newGrnNo))
            {
                return(InternalServerError());
            }
            return(Ok(newGrnNo));
        }
示例#4
0
        public IHttpActionResult DeleteGrnDetail(int TrxNo, int LineItemNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            int afRecCnt = GrnHelper.DeleteGrnDetail(TrxNo, LineItemNo);

            if (afRecCnt <= 0)
            {
                return(InternalServerError());
            }
            return(Ok());
        }
示例#5
0
        public IHttpActionResult AssignBinNo(int TrxNo, int LineItemNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            string BinNo = GrnHelper.AssignBinNo(TrxNo, LineItemNo);

            if (string.IsNullOrEmpty(BinNo))
            {
                return(InternalServerError());
            }
            return(Ok(BinNo));
        }
示例#6
0
        public IHttpActionResult AssignBinNos(int TrxNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var myGrnDetails = GrnHelper.AssignBinNos(TrxNo);

            if (myGrnDetails == null)
            {
                return(InternalServerError());
            }
            return(Ok(myGrnDetails));
        }
示例#7
0
        public IHttpActionResult SaveGrnDetail(whgr2 grnDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            int afRecCnt = GrnHelper.SaveGrnDetail(grnDetail);

            if (afRecCnt <= 0)
            {
                return(InternalServerError());
            }
            return(Ok());
        }
示例#8
0
        public IHttpActionResult GetGrnDetail(int TrxNo, int LineItemNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var myGrnDetail = GrnHelper.GetGrnDetail(TrxNo, LineItemNo);

            if (myGrnDetail == null)
            {
                return(InternalServerError());
            }
            return(Ok(myGrnDetail));
        }
示例#9
0
        public IHttpActionResult DeleteGrn(int TrxNo, int Type)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            int afRecCnt = GrnHelper.DeleteGrn(TrxNo, Type);

            if (afRecCnt <= 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }
示例#10
0
        public IHttpActionResult GetItems(string WarehouseCode, string SupplierCode)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var items = GrnHelper.GetPutAwayItem(WarehouseCode, SupplierCode);

            if (items == null)
            {
                return(InternalServerError());
            }
            return(Ok(items));
        }
示例#11
0
 public IHttpActionResult AssignBinNos(dynamic GrnDetails)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest());
     }
     foreach (var item in GrnDetails)
     {
         int    TrxNo      = item.TrxNo;
         int    LineItemNo = item.LineItemNo;
         string binNo      = GrnHelper.AssignBinNo(TrxNo, LineItemNo);
         item.BinNo = binNo;
     }
     return(Ok(GrnDetails));
 }
示例#12
0
        public IHttpActionResult GetGrn(int TrxNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var whgr1 = GrnHelper.GetGrn(TrxNo);
            var whgr2 = GrnHelper.GetGrnDetails(TrxNo);

            if (whgr1 == null)
            {
                return(InternalServerError());
            }
            var data = new { whgr1, whgr2 };

            return(Ok(data));
        }