public GEPBaseResultT InputDataToDB(List<SelectOptionParamT> lstSelOpt, BasketOrderParamT basketOrderParam) { GEPBaseResultT inputDataToDBResult = new GEPBaseResultT(); SelectOptionSetResultT selOptSetResult = new SelectOptionSetResultT(); BasketInfoSetResultT basketInfoResult = new BasketInfoSetResultT(); selOptSetResult = SetSelectOption(lstSelOpt); basketInfoResult = SetBasketInfo(basketOrderParam); if (selOptSetResult.RetCode == "N" || basketInfoResult.RetCode != "0") { inputDataToDBResult.RetCode = -1; inputDataToDBResult.RetMessage = "데이터 쓰기 실패"; } else { inputDataToDBResult.RetMessage = "데이터 쓰기 성공"; inputDataToDBResult.RetCode = 0; } return inputDataToDBResult; }
//장바구니 넣기에 적합한 형태로 변환 및 체크 private AvailableBasketInfoResultT InsertableBasketInfo(BasketParamT requestBasketParam, ref BasketOrderParamT basketOrderParam) { AvailableBasketInfoResultT inputResult = new AvailableBasketInfoResultT(); GEPBaseResultT verificationResult = new GEPBaseResultT(); inputResult.Result = new GEPBaseResultT(); BasketParamT basketParam = requestBasketParam; BasketInfoSetResultT basketInfoSetResult = new BasketInfoSetResultT(); try { basketParam = InitBasketParam(basketParam); //초기화 verificationResult = BasketVerification(basketParam); //Item value Verification if (verificationResult.RetCode == 0) { basketOrderParam = MakeBasketOrderParam(basketParam); //insert SP에 넘길 파라미터 만들기(ref형) if (basketParam.Pbid != null) { inputResult.BasketInfo = basketParam; inputResult.Result.RetCode = 0; inputResult.Result.RetMessage = "성공"; } } else { inputResult.Result.RetCode = verificationResult.RetCode; inputResult.Result.RetMessage = verificationResult.RetMessage; throw new ValidationException("Validation 검사 중 에러가 발생하였습니다."); } } catch (ValidationException ve) { Console.WriteLine(ve.Message); } catch (Exception e) { Console.WriteLine(e.Message); } return inputResult; }