public async Task <IActionResult> DeleteConfirmed(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ResultObject resultObj = null;

            try
            {
                using (var arrBll = new ArrivalBLL())
                {
                    var lstArr = await arrBll.GetArrival(id);

                    var arr = lstArr.First();

                    if (arr == null)
                    {
                        return(NotFound());
                    }

                    arr.Updated_By = await base.CurrentUserId();

                    //resultObj = await arrBll.DeleteProduct(arr);
                }

                return(Json(new { success = true, data = (T_Arrival_Header)resultObj.ObjectValue, message = "Arrival Deleted." }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }));
            }
        }
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ViewBag.CompCode = await base.CurrentUserComp();

            try
            {
                using (var arrBll = new ArrivalBLL())
                {
                    var lstArr = await arrBll.GetArrival(id);

                    var arr = lstArr.First();

                    if (arr == null)
                    {
                        return(NotFound());
                    }

                    return(PartialView(arr));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(new { success = false, message = ex.Message }));
            }
        }
        public async Task <IActionResult> GetArrival()
        {
            try
            {
                using (var arrBll = new ArrivalBLL())
                {
                    var lstArr = await arrBll.GetArrival(null);

                    return(Json(new { data = lstArr }));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(new { success = false, message = ex.Message }));
            }
        }
        public async Task <IActionResult> GetSearchArrival([Bind("ArrivalNo,DocRefNo,ArrivalTypeId,RawMatTypeId,ArrivalDateF,ArrivalDateT,DocRefDateF,DocRefDateT")] AdvSearchArrivalModel advArrModel)
        {
            try
            {
                using (var arrBll = new ArrivalBLL(await base.CurrentUserComp()))
                {
                    var lstArr = await arrBll.GetArrival(advArrModel.ArrivalNo, advArrModel.DocRefNo, advArrModel.ArrivalTypeId,
                                                         advArrModel.RawMatTypeId, advArrModel.ArrivalDateF, advArrModel.ArrivalDateT, advArrModel.DocRefDateF, advArrModel.DocRefDateT);

                    return(Json(new { data = lstArr }));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(new { success = false, message = ex.Message }));
            }
        }