Exemple #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));
        }
Exemple #2
0
        public IHttpActionResult DeleteFromInv(int TrxNo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            bool isValid = GinHelper.DeleteFromInv(TrxNo);

            if (!isValid)
            {
                return(InternalServerError());
            }
            return(Ok());
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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());
        }
Exemple #6
0
        public IHttpActionResult SaveGinDetails(IEnumerable <whgi2> ginDetails)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            bool isValid = GinHelper.SaveGinDetails(ginDetails);

            if (!isValid)
            {
                return(InternalServerError());
            }
            return(Ok());
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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());
        }