public string PhraseRetrieve(PhraseRetrieveReq req) { PhraseRetrieveRes res = new PhraseRetrieveRes(); if (Session["ID"] == null) { res.ReturnStatus = new ReturnStatus(ReturnCode.SESSION_TIMEOUT); } else { try { Log("Req=" + JsonConvert.SerializeObject(req)); res = new KYL_CMS.Models.BusinessLogic.Phrase("SCC").PaginationRetrieve(req); res.ReturnStatus = new ReturnStatus(ReturnCode.SUCCESS); } catch (Exception ex) { Log("Err=" + ex.Message); Log(ex.StackTrace); res.ReturnStatus = new ReturnStatus(ReturnCode.SERIOUS_ERROR); } } var json = JsonConvert.SerializeObject(res); Log("Res=" + json); return(json); }
public string PhraseCreate() { Stream stream = Request.InputStream; stream.Seek(0, SeekOrigin.Begin); string input = new StreamReader(stream).ReadToEnd(); Log(input); PhraseModifyReq req = new PhraseModifyReq(); JsonConvert.PopulateObject(input, req); PhraseModifyRes res = new PhraseModifyRes(); if (Session["ID"] == null) { res.ReturnStatus = new ReturnStatus(ReturnCode.SESSION_TIMEOUT); } else { try { Log("Req=" + JsonConvert.SerializeObject(req)); req.PHRASE.CUSER = Session["ID"].ToString(); req.PHRASE.MUSER = Session["ID"].ToString(); int i = new KYL_CMS.Models.BusinessLogic.Phrase("SCC").DataCreate(req); res = new PhraseModifyRes { PHRASE = req.PHRASE, ReturnStatus = new ReturnStatus(ReturnCode.ADD_SUCCESS) }; } catch (Exception ex) { Log("Err=" + ex.Message); Log(ex.StackTrace); res.ReturnStatus = new ReturnStatus(ReturnCode.SERIOUS_ERROR); } } var json = JsonConvert.SerializeObject(res); Log("Res=" + json); return(json); }