public JsonResult UpdateDbData(CDCItemImpViewModel model) { MSGReturnModel <bool> result = new MSGReturnModel <bool>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); if (Cache.IsSet(CacheList.CDCItemImpData)) { var dbData = (List <CDCItemImpViewModel>)Cache.Get(CacheList.CDCItemImpData); var updateTempData = dbData.FirstOrDefault(x => x.vItemId == model.vItemId); if (updateTempData != null) { var _vItemImp_Name_AFT = model.vItemImp_Name.CheckAFT(updateTempData.vItemImp_Name); if (_vItemImp_Name_AFT.Item2) { updateTempData.vItemImp_Name_AFT = _vItemImp_Name_AFT.Item1; } var _vItemImp_Remaining_AFT = TypeTransfer.intNToString(model.vItemImp_Remaining).CheckAFT(TypeTransfer.intNToString(updateTempData.vItemImp_Remaining)); if (_vItemImp_Remaining_AFT.Item2) { updateTempData.vItemImp_Remaining_AFT = TypeTransfer.stringToIntN(_vItemImp_Remaining_AFT.Item1); } var _vItemImp_Amount_AFT = TypeTransfer.decimalNToString(model.vItemImp_Amount).CheckAFT(TypeTransfer.decimalNToString(updateTempData.vItemImp_Amount)); if (_vItemImp_Amount_AFT.Item2) { updateTempData.vItemImp_Amount_AFT = TypeTransfer.stringToDecimal(_vItemImp_Amount_AFT.Item1); } var _vItemImp_Expected_Date_AFT = model.vItemImp_Expected_Date.CheckAFT(updateTempData.vItemImp_Expected_Date); if (_vItemImp_Expected_Date_AFT.Item2) { updateTempData.vItemImp_Expected_Date_AFT = _vItemImp_Expected_Date_AFT.Item1; } var _vItemImp_Description_AFT = model.vItemImp_Description.CheckAFT(updateTempData.vItemImp_Description); if (_vItemImp_Description_AFT.Item2) { updateTempData.vItemImp_Description_AFT = _vItemImp_Description_AFT.Item1; } var _vItemImp_MEMO_AFT = model.vItemImp_MEMO.CheckAFT(updateTempData.vItemImp_MEMO); if (_vItemImp_MEMO_AFT.Item2) { updateTempData.vItemImp_MEMO_AFT = _vItemImp_MEMO_AFT.Item1; } updateTempData.vAFTFlag = _vItemImp_Name_AFT.Item2 || _vItemImp_Remaining_AFT.Item2 || _vItemImp_Amount_AFT.Item2 || _vItemImp_Expected_Date_AFT.Item2 || _vItemImp_Description_AFT.Item2 || _vItemImp_MEMO_AFT.Item2; Cache.Invalidate(CacheList.CDCItemImpData); Cache.Set(CacheList.CDCItemImpData, dbData); result.Datas = dbData.Any(x => x.vAFTFlag); 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)); }
public JsonResult UpdateDbData(CDCMarginpViewModel model) { MSGReturnModel <bool> result = new MSGReturnModel <bool>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); if (Cache.IsSet(CacheList.CDCMarginpData)) { var dbData = (List <CDCMarginpViewModel>)Cache.Get(CacheList.CDCMarginpData); var updateTempData = dbData.FirstOrDefault(x => x.vItem_Id == model.vItem_Id); if (updateTempData != null) { var _vMargin_Take_Of_Type_AFT = model.vMargin_Take_Of_Type.CheckAFT(updateTempData.vMargin_Take_Of_Type); if (_vMargin_Take_Of_Type_AFT.Item2) { updateTempData.vMargin_Take_Of_Type_AFT = _vMargin_Take_Of_Type_AFT.Item1; } var _vTrad_Partners_AFT = model.vTrad_Partners.CheckAFT(updateTempData.vTrad_Partners); if (_vTrad_Partners_AFT.Item2) { updateTempData.vTrad_Partners_AFT = _vTrad_Partners_AFT.Item1; } var _vAmount_AFT = TypeTransfer.decimalNToString(model.vAmount).CheckAFT(TypeTransfer.decimalNToString(updateTempData.vAmount)); if (_vAmount_AFT.Item2) { updateTempData.vAmount_AFT = TypeTransfer.stringToDecimal(_vAmount_AFT.Item1); } var _vMargin_Item_AFT = model.vMargin_Item.CheckAFT(updateTempData.vMargin_Item); if (_vMargin_Item_AFT.Item2) { updateTempData.vMargin_Item_AFT = _vMargin_Item_AFT.Item1; } var _vMargin_Item_Issuer_AFT = model.vMargin_Item_Issuer.CheckAFT(updateTempData.vMargin_Item_Issuer); if (_vMargin_Item_Issuer_AFT.Item2) { updateTempData.vMargin_Item_Issuer_AFT = _vMargin_Item_Issuer_AFT.Item1; } var _vPledge_Item_No_AFT = model.vPledge_Item_No.CheckAFT(updateTempData.vPledge_Item_No); if (_vPledge_Item_No_AFT.Item2) { updateTempData.vPledge_Item_No_AFT = _vPledge_Item_No_AFT.Item1; } var _vEffective_Date_B_AFT = model.vEffective_Date_B.CheckAFT(updateTempData.vEffective_Date_B); if (_vEffective_Date_B_AFT.Item2) { updateTempData.vEffective_Date_B_AFT = _vEffective_Date_B_AFT.Item1; } var _vEffective_Date_E_AFT = model.vEffective_Date_E.CheckAFT(updateTempData.vEffective_Date_E); if (_vEffective_Date_E_AFT.Item2) { updateTempData.vEffective_Date_E_AFT = _vEffective_Date_E_AFT.Item1; } var _vDescription_AFT = model.vDescription.CheckAFT(updateTempData.vDescription); if (_vDescription_AFT.Item2) { updateTempData.vDescription_AFT = _vDescription_AFT.Item1; } var _vMemo_AFT = model.vMemo.CheckAFT(updateTempData.vMemo); if (_vMemo_AFT.Item2) { updateTempData.vMemo_AFT = _vMemo_AFT.Item1; } var _vBook_No_AFT = model.vBook_No.CheckAFT(updateTempData.vBook_No); if (_vBook_No_AFT.Item2) { updateTempData.vBook_No_AFT = _vBook_No_AFT.Item1; } updateTempData.vAFTFlag = _vMargin_Take_Of_Type_AFT.Item2 || _vTrad_Partners_AFT.Item2 || _vAmount_AFT.Item2 || _vMargin_Item_AFT.Item2 || _vMargin_Item_Issuer_AFT.Item2 || _vPledge_Item_No_AFT.Item2 || _vEffective_Date_B_AFT.Item2 || _vEffective_Date_E_AFT.Item2 || _vDescription_AFT.Item2 || _vMemo_AFT.Item2 || _vBook_No_AFT.Item2; Cache.Invalidate(CacheList.CDCMarginpData); Cache.Set(CacheList.CDCMarginpData, dbData); result.Datas = dbData.Any(x => x.vAFTFlag); 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)); }
public JsonResult UpdateDbData(CDCStockViewModel model) { MSGReturnModel <bool> result = new MSGReturnModel <bool>(); result.RETURN_FLAG = false; result.DESCRIPTION = Ref.MessageType.login_Time_Out.GetDescription(); if (Cache.IsSet(CacheList.CDCStockDataD)) { var dbData = (List <CDCStockViewModel>)Cache.Get(CacheList.CDCStockDataD); var updateTempData = dbData.FirstOrDefault(x => x.vItemId == model.vItemId); if (updateTempData != null) { var _vStock_Type_Aft = model.vStock_Type.CheckAFT(updateTempData.vStock_Type); if (_vStock_Type_Aft.Item2) { updateTempData.vStock_Type_Aft = _vStock_Type_Aft.Item1; } var _vStock_No_Preamble_Aft = model.vStock_No_Preamble.CheckAFT(updateTempData.vStock_No_Preamble); if (_vStock_No_Preamble_Aft.Item2) { updateTempData.vStock_No_Preamble_Aft = _vStock_No_Preamble_Aft.Item1; } var _vStock_No_B_Aft = model.vStock_No_B.CheckAFT(updateTempData.vStock_No_B); if (_vStock_No_B_Aft.Item2) { updateTempData.vStock_No_B_Aft = _vStock_No_B_Aft.Item1; } var _vStock_No_E_Aft = model.vStock_No_E.CheckAFT(updateTempData.vStock_No_E); if (_vStock_No_E_Aft.Item2) { updateTempData.vStock_No_E_Aft = _vStock_No_E_Aft.Item1; } var _vStock_Cnt_Aft = TypeTransfer.intNToString(model.vStock_Cnt).CheckAFT(TypeTransfer.intNToString(updateTempData.vStock_Cnt)); if (_vStock_Cnt_Aft.Item2) { updateTempData.vStock_Cnt_Aft = TypeTransfer.stringToIntN(_vStock_Cnt_Aft.Item1); } var _vAmount_Per_Share_Aft = TypeTransfer.decimalNToString(model.vAmount_Per_Share).CheckAFT(TypeTransfer.decimalNToString(updateTempData.vAmount_Per_Share)); if (_vAmount_Per_Share_Aft.Item2) { updateTempData.vAmount_Per_Share_Aft = TypeTransfer.stringToDecimal(_vAmount_Per_Share_Aft.Item1); } var _vSingle_Number_Of_Shares_Aft = TypeTransfer.decimalNToString(model.vSingle_Number_Of_Shares).CheckAFT(TypeTransfer.decimalNToString(updateTempData.vSingle_Number_Of_Shares)); if (_vSingle_Number_Of_Shares_Aft.Item2) { updateTempData.vSingle_Number_Of_Shares_Aft = TypeTransfer.stringToDecimal(_vSingle_Number_Of_Shares_Aft.Item1); } var _vDenomination_Aft = TypeTransfer.decimalNToString(model.vDenomination).CheckAFT(TypeTransfer.decimalNToString(updateTempData.vDenomination)); if (_vDenomination_Aft.Item2) { updateTempData.vDenomination_Aft = TypeTransfer.stringToDecimal(_vDenomination_Aft.Item1); } var _vDenominationTotal_Aft = TypeTransfer.decimalNToString(model.vDenominationTotal).CheckAFT(TypeTransfer.decimalNToString(updateTempData.vDenominationTotal)); if (_vDenominationTotal_Aft.Item2) { updateTempData.vDenominationTotal_Aft = TypeTransfer.stringToDecimal(_vDenominationTotal_Aft.Item1); } var _vNumberOfShares_Aft = TypeTransfer.decimalNToString(model.vNumberOfShares).CheckAFT(TypeTransfer.decimalNToString(updateTempData.vNumberOfShares)); if (_vNumberOfShares_Aft.Item2) { updateTempData.vNumberOfShares_Aft = TypeTransfer.stringToDecimal(_vNumberOfShares_Aft.Item1); } var _vMemo_Aft = model.vMemo.CheckAFT(updateTempData.vMemo); if (_vMemo_Aft.Item2) { updateTempData.vMemo_Aft = _vMemo_Aft.Item1; } updateTempData.vAftFlag = _vStock_Type_Aft.Item2 || _vStock_No_Preamble_Aft.Item2 || _vStock_No_B_Aft.Item2 || _vStock_No_E_Aft.Item2 || _vStock_Cnt_Aft.Item2 || _vAmount_Per_Share_Aft.Item2 || _vSingle_Number_Of_Shares_Aft.Item2 || _vDenomination_Aft.Item2 || _vDenominationTotal_Aft.Item2 || _vNumberOfShares_Aft.Item2 || _vMemo_Aft.Item2; Cache.Invalidate(CacheList.CDCStockDataD); Cache.Set(CacheList.CDCStockDataD, dbData); result.Datas = dbData.Any(x => x.vAftFlag); 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)); }