Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            string strjson = string.Empty;
            Guid   UserID  = Guid.Empty;

            if (!string.IsNullOrEmpty(context.Request["ID"]))
            {
                UserID = new Guid(context.Request["ID"]);
            }
            Guid albumid = Guid.Empty;

            if (!string.IsNullOrEmpty(context.Request["albumid"]))
            {
                albumid = new Guid(context.Request["albumid"]);
            }
            string isshare = "n";

            if (!string.IsNullOrEmpty(context.Request["isshare"]))
            {
                isshare = context.Request["isshare"];
            }
            UCHomeEntities uc = new UCHomeEntities();


            List <UCHome_Photo> photos = uc.UCHome_Photo.Where(p => p.AddUser == UserID && p.IsShow == 1).OrderByDescending(p => p.CreateTime).ToList();

            if (albumid != Guid.Empty)
            {
                List <Guid> relAblumPhotoIds =
                    uc.UCHome_Rel_AblumPhoto.Where(r => r.AlbumID == albumid).Select(p => p.PhotoID).ToList();
                photos = photos.Where(p => relAblumPhotoIds.Contains(p.PKID)).ToList();
            }
            //过滤不公开的相册
            if (isshare == "y")
            {
                List <Guid> albumids =
                    uc.UCHome_Album.Where(u => u.AddUser == UserID && u.IsShare != "0" && u.IsShow == 1)
                    .Select(u => u.PKID).ToList();
                List <Guid> sharephotoids =
                    uc.UCHome_Rel_AblumPhoto.Where(r => albumids.Contains(r.AlbumID)).Select(p => p.PhotoID).ToList();
                photos = photos.Where(p => sharephotoids.Contains(p.PKID)).ToList();
            }

            List <string> photodates = photos.Select(p => p.CreateTime.ToShortDateString()).Distinct().ToList();
            string        split      = string.Empty;

            for (int i = 0; i < photodates.Count; i++)
            {
                List <UCHome_Photo> childphotos =
                    photos.Where(p => p.CreateTime.ToShortDateString() == photodates[i]).ToList();
                string childphotojson = string.Empty;
                string childsplit     = string.Empty;
                foreach (UCHome_Photo photoitem in childphotos)
                {
                    childphotojson += string.Format("{2}{{\"photoid\":\"{0}\",\"photourl1\":\"{1}\",\"photourl2\":\"{5}\",\"photoname\":\"{3}\",\"flowers\":\"{4}\"}}",
                                                    photoitem.PKID, UCHome_BaseOper.ConvertThumbnail(photoitem.PhotoUrl, "max"), childsplit, photoitem.PhotoName, photoitem.flowers, UCHome_BaseOper.ConvertThumbnail(photoitem.PhotoUrl, "thumbnail"));
                    childsplit = ",";
                }
                childphotojson = string.Format("[{0}]", childphotojson);
                strjson       += string.Format("{2}{{\"photodate\":\"{0}\",\"photos\":{1}}}", DateTime.Parse(photodates[i]).ToString("yyyy年MM月dd日"), childphotojson, split);
                split          = ",";
            }
            strjson = string.Format("[{0}]", strjson);
            context.Response.ContentType = "text/plain";
            context.Response.Write(strjson);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }