public JsonResult Save(InventoryRecordArgs model)
        {
            long hotelId   = UserContext.CurrentUser.HotelId;
            var  apiResult = new APIResult();

            try
            {
                InventoryRecord inventoryRecord = model.Item1;
                inventoryRecord.InventoryRecordDetailsList = model.Item2;
                InventoryRecordBll.AddOrUpdate(inventoryRecord, UserContext.CurrentUser.Name, hotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }

            return(Json(apiResult));
        }
        public ActionResult Preview(long id = 0)
        {
            long hotelId = UserContext.CurrentUser.HotelId;

            ViewData["warehourse"] = WarehouseBll.GetAllList(hotelId);
            if (id == 0)
            {
                return(View(new InventoryRecordArgs()
                {
                    Item1 = new InventoryRecord(), Item2 = new List <InventoryRecordDetails>()
                }));
            }


            InventoryRecord model = InventoryRecordBll.GetById(id);
            var             info  = new InventoryRecordArgs
            {
                Item1 = model,
                Item2 = model.InventoryRecordDetailsList
            };

            return(View(info));
        }