示例#1
0
        public JsonResult TakeOutData(CAViewModel model, bool takeoutFlag)
        {
            MSGReturnModel <bool> result = new MSGReturnModel <bool>();

            result.RETURN_FLAG = false;
            result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription();
            if (Cache.IsSet(CacheList.CAData))
            {
                var tempData       = (List <CAViewModel>)Cache.Get(CacheList.CAData);
                var updateTempData = tempData.FirstOrDefault(x => x.vItemId == model.vItemId);
                if (updateTempData != null)
                {
                    if (takeoutFlag)
                    {
                        updateTempData.vStatus = Ref.AccessInventoryType._4.GetDescription();
                    }
                    else
                    {
                        updateTempData.vStatus = Ref.AccessInventoryType._1.GetDescription();
                    }
                    updateTempData.vtakeoutFlag = takeoutFlag;
                    Cache.Invalidate(CacheList.CAData);
                    Cache.Set(CacheList.CAData, tempData);
                    result.RETURN_FLAG = true;
                    result.DESCRIPTION = Ref.MessageType.update_Success.GetDescription();
                    result.Datas       = tempData.Any(x => x.vtakeoutFlag);
                }
                else
                {
                    result.RETURN_FLAG = false;
                    result.DESCRIPTION = Ref.MessageType.update_Fail.GetDescription();
                }
            }
            return(Json(result));
        }
示例#2
0
        public JsonResult UpdateTempData(CAViewModel model)
        {
            MSGReturnModel <string> result = new MSGReturnModel <string>();

            result.RETURN_FLAG = false;
            result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription();
            if (Cache.IsSet(CacheList.CAData))
            {
                var tempData       = (List <CAViewModel>)Cache.Get(CacheList.CAData);
                var updateTempData = tempData.FirstOrDefault(x => x.vItemId == model.vItemId);
                if (updateTempData != null)
                {
                    updateTempData.vCA_Desc   = model.vCA_Desc;
                    updateTempData.vCA_Use    = model.vCA_Use;
                    updateTempData.vCA_Number = model.vCA_Number;
                    updateTempData.vBank      = model.vBank;
                    updateTempData.vMemo      = model.vMemo;
                    Cache.Invalidate(CacheList.CAData);
                    Cache.Set(CacheList.CAData, tempData);
                    result.RETURN_FLAG = true;
                    result.DESCRIPTION = Ref.MessageType.update_Success.GetDescription();
                }
                else
                {
                    result.RETURN_FLAG = false;
                    result.DESCRIPTION = Ref.MessageType.update_Fail.GetDescription();
                }
            }
            return(Json(result));
        }
示例#3
0
        public JsonResult DeleteTempData(CAViewModel model)
        {
            MSGReturnModel <bool> result = new MSGReturnModel <bool>();

            result.RETURN_FLAG = false;
            result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription();
            if (Cache.IsSet(CacheList.CAData))
            {
                var tempData       = (List <CAViewModel>)Cache.Get(CacheList.CAData);
                var deleteTempData = tempData.FirstOrDefault(x => x.vItemId == model.vItemId);
                if (deleteTempData != null)
                {
                    tempData.Remove(deleteTempData);
                    Cache.Invalidate(CacheList.CAData);
                    Cache.Set(CacheList.CAData, tempData);
                    result.RETURN_FLAG = true;
                    result.DESCRIPTION = Ref.MessageType.delete_Success.GetDescription();
                    result.Datas       = tempData.Any();
                }
                else
                {
                    result.RETURN_FLAG = false;
                    result.DESCRIPTION = Ref.MessageType.delete_Fail.GetDescription();
                }
            }
            return(Json(result));
        }
示例#4
0
        public JsonResult InsertTempData(CAViewModel model)
        {
            MSGReturnModel <string> result = new MSGReturnModel <string>();

            result.RETURN_FLAG = false;
            result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription();
            if (Cache.IsSet(CacheList.CAData))
            {
                var tempData = (List <CAViewModel>)Cache.Get(CacheList.CAData);
                model.vStatus = Ref.AccessInventoryType._3.GetDescription();
                tempData.Add(model);
                Cache.Invalidate(CacheList.CAData);
                Cache.Set(CacheList.CAData, tempData);
                result.RETURN_FLAG = true;
                result.DESCRIPTION = Ref.MessageType.insert_Success.GetDescription();
            }
            return(Json(result));
        }