/// <summary> /// 리뷰 데이터 삭제(업데이트) /// </summary> /// <param name="sContentID"></param> /// <param name="sReviewSeq"></param> /// <param name="sUserID"></param> /// <returns></returns> public string U_MA_USR_REV_SIN(string CONS_ID, string REV_SEQ, string USER_NO) { List <string> arrResult = new List <string>(); using (imrEntities entities = new imrEntities()) { try { int reviewSeq = int.Parse(REV_SEQ); var UpdateData = entities.OTCSREVW.Where(a => a.CONS_ID == CONS_ID && a.REV_SEQ == reviewSeq && a.USER_NO == USER_NO).SingleOrDefault(); if (UpdateData != null) { UpdateData.USE_YN = "N"; entities.SaveChanges(); arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "N" , ERROR_DOC = "성공" } ))); } else { arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "N" , ERROR_DOC = "업데이트할 데이터가 없습니다." } ))); } } catch (Exception ex) { arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "N" , ERROR_DOC = "데이터 업데이트에 실패하였습니다. err message: " + ex.Message } ))); } } return(StaticUtils.ListToXml(arrResult)); }
/// <summary> /// 찜 목록 데이터 삭제 /// </summary> /// <param name="sContentID"></param> /// <param name="sUserID"></param> /// <returns></returns> public string D_MA_USR_FAV_SIN(string CONS_ID, string USER_NO) { List <string> arrResult = new List <string>(); using (imrEntities entities = new imrEntities()) { try { var DeleteData = entities.OTUSMYLT.Where(a => a.CONS_ID == CONS_ID && a.USER_NO == USER_NO).SingleOrDefault(); if (DeleteData != null) { entities.OTUSMYLT.Remove(DeleteData); entities.SaveChanges(); arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "N" , ERROR_DOC = "성공" } ))); } else { arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "Y" , ERROR_DOC = "삭제할 데이터가 없습니다." } ))); } } catch (Exception ex) { arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "Y" , ERROR_DOC = "데이터 삭제에 실패하였습니다. err message: " + ex.Message } ))); } } return(StaticUtils.ListToXml(arrResult)); }
/// <summary> /// 리뷰 입력 작업중 /// </summary> /// <param name="USER_NO"></param> /// <param name="CONS_ID"></param> /// <param name="REV_DOC"></param> /// <param name="CONS_ST"></param> /// <returns></returns> public string I_MA_USR_REV_SIN(string USER_NO, string CONS_ID, string REV_DOC, string CONS_ST) { List <string> arrResult = new List <string>(); using (imrEntities entities = new imrEntities()) { try { OTCSREVW reviewData = new OTCSREVW { USER_NO = USER_NO, CONS_ID = CONS_ID, REV_DOC = REV_DOC, CONS_ST = CONS_ST, REV_DTM = DateTime.Now, CONS_SEQ = entities.OTCSINFO.Where(a => a.CONS_ID == CONS_ID && a.USE_YN == "Y").SingleOrDefault().CONS_SEQ, REV_SEQ = entities.OTCSREVW.Where(a => a.CONS_ID == CONS_ID && a.USE_YN == "Y").Count() + 1, USE_YN = "Y" }; entities.OTCSREVW.Add(reviewData); entities.SaveChanges(); arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "N", ERROR_DOC = "성공" } ))); } catch (Exception ex) { arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "Y", ERROR_DOC = "데이터 입력에 실패하였습니다. err message: " + ex.Message } ))); } } return(StaticUtils.ListToXml(arrResult)); }
/// <summary> /// 구매내역 리스트 입력 /// </summary> /// <param name="USER_NO"></param> /// <param name="CONS_ID"></param> /// <returns></returns> public string I_MA_USR_PRCH_SIN(string USER_NO, string CONS_ID) { List <string> arrResult = new List <string>(); using (imrEntities entities = new imrEntities()) { try { OTUSCSLT purchaseData = new OTUSCSLT { USER_NO = USER_NO, CONS_ID = CONS_ID, CONS_BUY_DTM = DateTime.Now, CONS_SEQ = entities.OTUSCSLT.Count() }; entities.OTUSCSLT.Add(purchaseData); entities.SaveChanges(); arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "N" , ERROR_DOC = "성공" } ))); } catch (Exception ex) { arrResult.Add(StaticUtils.DictionaryToXml(StaticUtils.GetDictionaryFieldValue( new ErrorReturn() { ERROR_YN = "Y" , ERROR_DOC = "데이터 입력에 실패하였습니다. err message: " + ex.Message } ))); } } return(StaticUtils.ListToXml(arrResult)); }