public async Task <IActionResult> RegisterStockexcess([FromBody] JObject objData)
        {
            var result = await Task.Run(() =>
            {
                APIResponse apiResponse = null;
                if (objData == null)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = "Request is empty"
                    }));
                }
                try
                {
                    var _stockrexcessHdr = objData["StockexcessHdr"].ToObject <TblStockExcessMaster>();
                    var _stockexcessDtl  = objData["StockexcessDtl"].ToObject <TblStockExcessDetails[]>();

                    var result  = new StockExcessHelper().RegisterStocksexcess(_stockrexcessHdr, _stockexcessDtl.ToList());
                    apiResponse = new APIResponse()
                    {
                        status = APIStatus.PASS.ToString(), response = result
                    };
                    return(Ok(apiResponse));
                }
                catch (Exception ex)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = ex.Message
                    }));
                }
            });

            return(result);
        }
        public async Task <IActionResult> GetStockexcessList([FromBody] VoucherNoSearchCriteria searchCriteria)
        {
            var result = await Task.Run(() =>
            {
                if (searchCriteria == null)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = "Request is empty"
                    }));
                }
                try
                {
                    var stockexcessListMasterList = new StockExcessHelper().GetStockexcessList(searchCriteria);
                    if (stockexcessListMasterList.Count > 0)
                    {
                        dynamic expando         = new ExpandoObject();
                        expando.StockexcessList = stockexcessListMasterList;
                        return(Ok(new APIResponse()
                        {
                            status = APIStatus.PASS.ToString(), response = expando
                        }));
                    }

                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = "No StockreceiptsList record found."
                    }));
                }
                catch (Exception ex)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = ex.Message
                    }));
                }
            });

            return(result);
        }
        public async Task <IActionResult> GetStockExcessDetailsList(decimal id)
        {
            var result = await Task.Run(() =>
            {
                if (id == 0)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = "Request is empty"
                    }));
                }
                try
                {
                    var stockExcessDetailsList = new StockExcessHelper().StockexcessDeatilList(id);
                    if (stockExcessDetailsList.Count > 0)
                    {
                        dynamic expando            = new ExpandoObject();
                        expando.StockExcessDetails = stockExcessDetailsList;
                        return(Ok(new APIResponse()
                        {
                            status = APIStatus.PASS.ToString(), response = expando
                        }));
                    }

                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = "No Billing record found."
                    }));
                }
                catch (Exception ex)
                {
                    return(Ok(new APIResponse()
                    {
                        status = APIStatus.FAIL.ToString(), response = ex.Message
                    }));
                }
            });

            return(result);
        }