예제 #1
0
        public IHttpActionResult SaveGin(whgi1 gin)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            int trxNo = GinHelper.SaveGin(gin);

            if (trxNo <= 0)
            {
                return(InternalServerError());
            }
            return(Ok(trxNo));
        }
예제 #2
0
        public IHttpActionResult DeleteFromInv(int TrxNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            bool isValid = GinHelper.DeleteFromInv(TrxNo);

            if (!isValid)
            {
                return(InternalServerError());
            }
            return(Ok());
        }
예제 #3
0
        public IHttpActionResult GetGin(int TrxNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var myGin = GinHelper.GetGin(TrxNo);

            if (myGin == null)
            {
                return(NotFound());
            }
            return(Ok(myGin));
        }
예제 #4
0
        public IHttpActionResult GetNewGinNo(DateTime IssueDate)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            string newGinNo = GinHelper.GetNewGinNo(IssueDate);

            if (string.IsNullOrEmpty(newGinNo))
            {
                return(InternalServerError());
            }
            return(Ok(newGinNo));
        }
예제 #5
0
        public IHttpActionResult DeleteGinDetail(int TrxNo, int LineItemNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            bool isValid = GinHelper.DeleteGinDetail(TrxNo, LineItemNo);

            if (!isValid)
            {
                return(InternalServerError());
            }
            return(Ok());
        }
예제 #6
0
        public IHttpActionResult SaveGinDetails(IEnumerable <whgi2> ginDetails)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            bool isValid = GinHelper.SaveGinDetails(ginDetails);

            if (!isValid)
            {
                return(InternalServerError());
            }
            return(Ok());
        }
예제 #7
0
        public IHttpActionResult GetGinDetail(int TrxNo, int LineItemNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var ginDetail = GinHelper.GetGinDetail(TrxNo, LineItemNo);

            if (ginDetail == null)
            {
                return(NotFound());
            }
            return(Ok(ginDetail));
        }
예제 #8
0
        public IHttpActionResult GetGinDetails(int TrxNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var ginDetails = GinHelper.GetGinDetails(TrxNo);

            if (ginDetails == null)
            {
                return(InternalServerError());
            }
            return(Ok(ginDetails));
        }
예제 #9
0
        public IHttpActionResult DeleteGin(int TrxNo, int Type)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            bool isValid = GinHelper.DeleteGin(TrxNo, Type);

            if (!isValid)
            {
                return(NotFound());
            }
            return(Ok());
        }