public void ProcessRequest(HttpContext context) { Guid id = Guid.Empty; if (!string.IsNullOrEmpty(context.Request["ID"])) { id = new Guid(context.Request["ID"]); } UCHomeEntities uc = new UCHomeEntities(); string strid = id.ToString(); List <View_UCHome_Dicuss> dicussInfos = uc.View_UCHome_Dicuss.Where(u => u.AddUser == id || u.groupuser.Contains(strid)).OrderByDescending(u => u.CreateDate).ToList(); string Newjson = ""; string split = string.Empty; foreach (View_UCHome_Dicuss item in dicussInfos) { Newjson += string.Format("{7}{{\"dicusstopic\":\"{0}\",\"abstracts\":\"{1}\",\"createdate\":\"{2}\",\"id\":\"{3}\",\"nickname\":\"{4}\",\"headphoto\":\"{5}\",\"usertype\":\"{6}\"}}", item.DicussTopic, UCHome_BaseOper.EncodeBase64(item.Abstracts), item.CreateDate.ToShortDateString(), item.PKID, item.NickName, item.headphoto, item.UserType, split); split = ","; } Newjson = string.Format("[{0}]", Newjson); context.Response.ContentType = "text/plain"; context.Response.Write(Newjson); }
public void ProcessRequest(HttpContext context) { Guid id = Guid.Empty; if (!string.IsNullOrEmpty(context.Request["ID"])) { id = new Guid(context.Request["ID"]); } string isshare = "n"; if (!string.IsNullOrEmpty(context.Request["isshare"])) { isshare = context.Request["isshare"]; } IEnumerable <UCHome_Album> ablumlist = GetAlbumListBySelf(id, isshare); string Newjson = ""; string split = string.Empty; foreach (UCHome_Album item in ablumlist) { Newjson += string.Format("{0}{{\"user\":\"{1}\",\"time\":\"{2}\",\"title\":\"{3}\",\"abstract\":\"{4}\",\"hits\":\"{5}\",\"isshare\":\"{6}\",\"pkid\":\"{7}\",\"themes\":\"{8}\",\"albumtype\":\"{9}\",\"coverimg\":\"{10}\"}}", split, item.AddUser, item.CreateTime.ToShortDateString(), item.AlbumName, UCHome_BaseOper.EncodeBase64(item.AlbumAbstract), item.Hits, item.IsShare, item.PKID, item.AlbumThemes, item.AlbumType, item.CoverImg); split = ","; } Newjson = string.Format("[{0}]", Newjson); context.Response.ContentType = "text/plain"; context.Response.Write(Newjson); }
public void ProcessRequest(HttpContext context) { Guid id = Guid.Empty; if (!string.IsNullOrEmpty(context.Request["ID"])) { id = new Guid(context.Request["ID"]); } int top = 5; if (!string.IsNullOrEmpty(context.Request["pagesize"])) { top = int.Parse(context.Request["pagesize"]); } int pageindex = 1; if (!string.IsNullOrEmpty(context.Request["curpage"])) { pageindex = int.Parse(context.Request["curpage"]); } string uctype = "new"; if (!string.IsNullOrEmpty(context.Request["uctype"])) { uctype = context.Request["uctype"]; } string isshare = "n"; if (!string.IsNullOrEmpty(context.Request["isshare"])) { isshare = context.Request["isshare"]; } IEnumerable <LogInfo> loglist = GetNewInfoBySelf(id, top, uctype, pageindex, isshare); string Newjson = ""; string split = string.Empty; foreach (LogInfo item in loglist) { Newjson += string.Format("{0}{{\"user\":\"{1}\",\"time\":\"{2}\",\"title\":\"{3}\",\"abstract\":\"{4}\",\"hits\":\"{5}\",\"isshare\":\"{6}\",\"isaudit\":\"{7}\",\"isshow\":\"{8}\",\"pkid\":\"{9}\",\"flowers\":\"{10}\"}}", split, item.loguser, item.logdate.ToShortDateString(), UCHome_BaseOper.EncodeBase64(item.logtitle), UCHome_BaseOper.EncodeBase64(item.logabstract), item.loghits, item.logisshare, item.logisaudit, item.logisshow, item.pkid, item.flowers); split = ","; } Newjson = string.Format("[{0}]", Newjson); context.Response.ContentType = "text/plain"; context.Response.Write(Newjson); }
public void ProcessRequest(HttpContext context) { Guid id = Guid.Empty; if (!string.IsNullOrEmpty(context.Request["ID"])) { id = new Guid(context.Request["ID"]); } int top = 5; if (!string.IsNullOrEmpty(context.Request["pagesize"])) { top = int.Parse(context.Request["pagesize"]); } int pageindex = 1; if (!string.IsNullOrEmpty(context.Request["curpage"])) { pageindex = int.Parse(context.Request["curpage"]); } IEnumerable <View_UCHome_Leave> msglist = GetNewInfoBySelf(id, top, pageindex); string Newjson = ""; string split = string.Empty; foreach (View_UCHome_Leave item in msglist) { Newjson += string.Format("{0}{{\"messageuser\":\"{1}\",\"time\":\"{2}\",\"contents\":\"{3}\",\"orders\":\"{4}\",\"msgtype\":\"{5}\",\"parentid\":\"{6}\",\"isshow\":\"{7}\",\"pkid\":\"{8}\",\"flowers\":\"{9}\",\"msgname\":\"{10}\",\"headimg\":\"{11}\"}}", split, item.MessageUserID, item.EditDate.ToShortDateString(), UCHome_BaseOper.EncodeBase64(item.Contents), item.orders, item.msgtype, item.parentid, item.isshow, item.PKID, item.flowers, item.NickName, item.headphoto); split = ","; } Newjson = string.Format("[{0}]", Newjson); context.Response.ContentType = "text/plain"; context.Response.Write(Newjson); }
public void ProcessRequest(HttpContext context) { Guid id = Guid.Empty; if (!string.IsNullOrEmpty(context.Request.QueryString["pid"])) { id = new Guid(context.Request.QueryString["pid"]); } LogInfo item = GetLogInfoBySelf(id); string Logjson = string.Format("{0}{{\"user\":\"{1}\",\"time\":\"{2}\",\"title\":\"{3}\",\"abstract\":\"{4}\",\"hits\":\"{5}\",\"isshare\":\"{6}\",\"isaudit\":\"{7}\",\"isshow\":\"{8}\",\"pkid\":\"{9}\"}}", "", item.loguser, item.logdate.ToShortDateString(), item.logtitle, UCHome_BaseOper.EncodeBase64(item.logabstract), item.loghits, item.logisshare, item.logisaudit, item.logisshow, item.pkid); Logjson = string.Format("[{0}]", Logjson); context.Response.ContentType = "text/plain"; context.Response.Write(Logjson); }
public void ProcessRequest(HttpContext context) { Guid id = Guid.Empty; if (!string.IsNullOrEmpty(context.Request.QueryString["ID"])) { id = new Guid(context.Request.QueryString["ID"]); } int top = 5; if (!string.IsNullOrEmpty(context.Request.QueryString["topcount"])) { top = int.Parse(context.Request.QueryString["topcount"]); } string Newtype = "self"; if (!string.IsNullOrEmpty(context.Request.QueryString["NewType"])) { Newtype = context.Request.QueryString["NewType"]; } List <NewInfo> Newlist; switch (Newtype) { case "self": Newlist = GetNewInfoBySelf(id, top); break; case "classtea": Newlist = GetNewInfoByClassTea(id, top); break; case "classstu": Newlist = GetNewInfoByClassStu(id, top); break; case "classes": Newlist = GetArtileInfoByClassTea(id, top); break; case "hotclasses": Newlist = GetHotInfoByClassTea(id, top); break; default: Newlist = GetNewInfoByClassTea(id, top); Newlist.AddRange(GetNewInfoByClassStu(id, top)); break; } string Newjson = ""; string split = string.Empty; foreach (NewInfo item in Newlist) { Newjson += string.Format("{0}{{\"newsuser\":\"{1}\",\"newscontent\":\"{2}\",\"newsdate\":\"{3}\",\"writefrom\":\"{4}\",\"pid\":\"{5}\",\"title\":\"{6}\"}}", split, item.NewUser, UCHome_BaseOper.EncodeBase64(item.Newcontent), item.NewDate.ToShortDateString(), item.writefrom, item.pid, item.title); split = ","; } Newjson = string.Format("[{0}]", Newjson); context.Response.ContentType = "text/plain"; context.Response.Write(Newjson); }