Example #1
0
 private void BindNew()
 {
     //取前三条
     IEnumerable<CY.UME.Core.Business.Activities> getActivieHotList = CY.UME.Core.Business.Activities.GetHotTop4();
     ActiveList = getActivieHotList.ToList();
     if (ActiveList != null && ActiveList.Count > 0)
     {
         Top = ActiveList[0];
     }
     ActiveList.Remove(Top);
 }
Example #2
0
        private void BindDetail(int aid)
        {
            CY.UME.Core.Business.Activities ac = CY.UME.Core.Business.Activities.Load(aid);
            if (ac != null)
            {
                active = ac;
                //HotTopic.active = ac;//最热话题
                //LeaveWord.activit = ac;//留言版
                //member.activeID = aid;//活动成员
                //meun1.ActiveID = aid;//活动菜单
                //hotPicture.active = ac;//图片
                //PicTop.active = ac;
                //memberInGroup.activeID = aid;
                //InOtherActive.activeID = aid;//他们还喜欢

                if (CurrentAccount != null)
                {

                    if (ac.Sponsor == CurrentAccount.Id)//发起人
                    {
                        IsManage = true;
                        btnJoin.Visible = false;
                        divJoin.Visible = true;
                        divJoin.Value = "我已参加";
                        //btnInterest.Visible = false;
                        //divInterest.Visible = true;
                        //imgInterest.Src = "images/activity_wygz.jpg";
                        //btnExit.Visible = false;
                        //btnInterest.Visible = false;
                        //btnNoInterest.Visible = false;
                    }
                    else//其它人
                    {
                        List<CY.UME.Core.Business.ActivitieParticipants> listTT = CY.UME.Core.Business.ActivitieParticipants.GetByActiveIDandAccountID(aid, CurrentAccount.Id, 1).ToList();
                        if (listTT != null && listTT.Count > 0)
                        {
                            btnJoin.Visible = false;
                            btnJoin.Value = "我要参加";
                            divJoin.Visible = true;
                            //imgJoin.Src = "../Theme/V3/images/Addressee_message-blue.gif";//

                            //btnExit.Visible = true;//我不参加
                            //btnInterest.Visible = false;
                            //btnNoInterest.Visible = false;
                            //divInterest.Visible = true;
                            //imgInterest.Src = "images/activity_wygz.jpg";
                        }

                        List<CY.UME.Core.Business.ActivitieParticipants> listT = CY.UME.Core.Business.ActivitieParticipants.GetByActiveIDandAccountID(aid, CurrentAccount.Id, 2).ToList();
                        if (listT != null && listT.Count > 0)
                        {
                            //btnInterest.Visible = false;
                            //divInterest.Visible = true;
                            //imgInterest.Src = "images/activity_wygz.jpg";
                            //btnInterest.Visible = false;
                            //btnNoInterest.Visible = true;//不感兴趣
                        }
                    }
                }

                ActiveID = ac.Id;
                if (ac.Address.Length >= 72)
                {//显示部分
                    tbAddress.Text = ac.Address.Substring(0, 72) + "...";
                    tbAddress.ToolTip = ac.Address;
                }
                else
                {//完整显示
                    tbAddress.Text = ac.Address;
                    tbAddress.ToolTip = ac.Address;
                }
                tbName.InnerText = ac.Name;
                ActiveName = ac.Name;
                SetTitle(ac.Name);
                tbSponor.Text = "<a href=" + SiteUrl + "/Home.aspx?uid=" + ac.Sponsor + " target=\"_blank\">" + ac.SponsorName + "</a>";
                tbStartTime.InnerText = ac.StartTime.ToString("yyyy年MM月dd日 HH:mm");
                tbEndTime.InnerText = ac.EndTime.ToString("yyyy年MM月dd日 HH:mm");

                if (ac.Organizer == default(long))
                {
                    tbOrgin.InnerText = "私人举办";
                }
                else
                {
                    tbOrgin.InnerText = ac.OrganizerName;
                }
                if (!string.IsNullOrEmpty(ac.Pic))
                {
                    hasPic = true;
                    picBigUrl = ac.Pic;
                    int aCount = picBigUrl.LastIndexOf('.');
                    string temp = picBigUrl.Substring(aCount, ac.Pic.Length - aCount);
                    int count = picBigUrl.LastIndexOf("_small");
                    if (count > 0)
                    {
                        picBigUrl = picBigUrl.Substring(0, count);
                        picBigUrl += "_big" + temp;
                    }
                }
                else
                {
                    picBigUrl = "images/defaultPic.jpg";
                }
                tbJoin.InnerText = ac.JoinMember.ToString();
                tbInterest.InnerText = ac.InterestMember.ToString();

                if (string.IsNullOrEmpty(ac.Overview))
                {
                    hasOverView = false;
                }
                else
                {
                    hasOverView = true;
                    lbOverView.Text = ac.Overview;
                }

                //如果活动已结束,则不显示邀请好友的菜单
                if (ac.EndTime <= DateTime.Now)
                {
                    isEnd = true;
                    //meun1.isInventFriendBtn = false;
                    //btnInventFriend.Visible = false;
                    //btnInterest.Src = "";
                    //btnInterest.Attributes.Add("Enabled", "false");
                    //btnInventFriend.Src = "";
                    btnInventFriend.Visible = false;
                    divOver.Visible = true;

                    btnJoin.Visible = false;
                    divJoin.Visible = false;
                    divJoin.Value = "我已参加";
                    imgJoin.Src = "images/endJoin.png";

                    //btnInterest.Visible = false;
                    //divInterest.Visible = true;
                    //imgInterest.Src = "images/endInterest.jpg";
                }
            }
            else
            {
                Response.Write("此活动不存在或已经被删除");
                return;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            try
            {
                long instanceId; // 空间用户的标识 || 群Id
                long referedId; // 回复留言的标识
                string content;
                string type = String.Empty;//类型(SpaceCommentExtend)
                CY.UME.Core.Business.Account currentAccount; // 留言的用户
                CY.UME.Core.Business.Account spaceAccount = new CY.UME.Core.Business.Account(); // 所在个人主页的用户
                CY.UME.Core.Business.SpaceComment referedComment = new CY.UME.Core.Business.SpaceComment(); // 所回复的留言
                CY.UME.Core.Business.SpaceComment comment = new CY.UME.Core.Business.SpaceComment(); // 留言
                CY.UME.Core.Business.Group group = new CY.UME.Core.Business.Group();//群组
                CY.UME.Core.Business.Activities active = new CY.UME.Core.Business.Activities();//活动

                #region Validateion and Get Basic Data

                if (!CY.Utility.Common.ParseUtility.TryParseInt64(context.Request.Form["uid"], out instanceId) ||
                    !CY.Utility.Common.ParseUtility.TryParseInt64(context.Request.Form["referedId"], out referedId))
                {
                    context.Response.Write("{success:false,msg:'参数错误'}");
                    return;
                }

                if (context.Request.Form["type"] != null)
                {
                    type = context.Request.Form["type"].ToString();
                }

                currentAccount = CY.UME.Core.Global.GetCurrentAccount();
                if (currentAccount == null)
                {
                    context.Response.Write("{success:false,msg:'登录超时,请重新登录'}");
                    return;
                }

                // 所在个人主页的用户
                if (instanceId == 0 && type.Length == 0)
                {
                    instanceId = currentAccount.Id;
                    spaceAccount = currentAccount;
                }
                else if (type.Length == 0)
                {
                    spaceAccount = CY.UME.Core.Business.Account.Load(instanceId);

                    if (spaceAccount == null)
                    {
                        context.Response.Write("{success:false,msg:'用户不存在'}");
                        return;
                    }
                }
                else if (type == "group")
                {
                    group = CY.UME.Core.Business.Group.Load((int)instanceId);

                    if (group == null)
                    {
                        context.Response.Write("{success:false,msg:'该群组不存在或已被删除'}");
                        return;
                    }
                }
                else if (type == "active")
                {
                    active = CY.UME.Core.Business.Activities.Load((int)instanceId);
                    if (active == null)
                    {
                        context.Response.Write("{success:false,msg:'该活动不存在或已被删除'}");
                        return;
                    }
                }

                // 所回复的留言
                if (referedId > 0)
                {
                    referedComment = CY.UME.Core.Business.SpaceComment.Load(referedId);
                    if (referedComment == null)
                    {
                        context.Response.Write("{success:false,msg:'所回复的留言已被删除'}");
                        return;
                    }
                }

                // 留言内容
                content = context.Request.Form["content"];
                if (string.IsNullOrEmpty(content))
                {
                    context.Response.Write("{success:false,msg:'留言内容不能为空'}");
                    return;
                }

                #endregion

                #region Leave Msg,Notice

                if (type.Length == 0)//个人空间留言
                {
                    // 将留言或者回复信息发送给空间主人
                    comment.AccountId = spaceAccount.Id;
                    comment.Content = content;
                    comment.IsPublic = (context.Request.Form["isPublic"] == "0") ? false : true;
                    comment.ReferedId = referedId;
                    comment.AuthorId = currentAccount.Id;
                    comment.DateCreated = DateTime.Now;
                    comment.InstanceId = 0;
                    comment.IP = CY.Utility.Common.RequestUtility.ClientIP;
                    comment.Save();

                    if (spaceAccount.Id != currentAccount.Id) // 不是在自己空间,留言则通知空间主人,回复则通知所回复的留言的作者
                    {
                        CY.UME.Core.Business.Notice notice = new CY.UME.Core.Business.Notice();
                        notice.AuthorId = comment.AuthorId;
                        notice.IsReaded = false;
                        notice.DateCreated = DateTime.Now;
                        notice.InstanceId = comment.Id.ToString();

                        if (comment.ReferedId < 1) // 留言
                        {
                            notice.Type = "info";
                            notice.AccountId = instanceId;
                            //notice.Content = currentAccount.Name + "给您留言了";
                            notice.Content = "给您留言了";
                            notice.Save();
                        }
                        else // 回复
                        {
                            if (referedComment.Id > 0)
                            {
                                notice.Type = "inforeply";
                                notice.AccountId = referedComment.AuthorId;

                                if (referedComment.AuthorId == spaceAccount.Id) // 回复空间主人
                                {
                                    //notice.Content = currentAccount.Name + "回复了您的留言";
                                    notice.Content = "回复了您的留言";
                                }
                                else // 在别人页面回复了另外一个人
                                {
                                    //notice.Content = currentAccount.Name + "回复了您在 " + spaceAccount.Name + " 处的留言";
                                    notice.Content = "回复了您在 " + spaceAccount.Name + " 处的留言";

                                    // 在所引用的留言的作者处添加一条回复副本
                                    CY.UME.Core.Business.SpaceComment commentCopy = new CY.UME.Core.Business.SpaceComment();
                                    commentCopy.AccountId = referedComment.AuthorId;
                                    commentCopy.AuthorId = currentAccount.Id;
                                    commentCopy.Content = comment.Content;
                                    commentCopy.DateCreated = comment.DateCreated;
                                    commentCopy.InstanceId = comment.InstanceId;
                                    commentCopy.IP = comment.IP;
                                    commentCopy.IsPublic = comment.IsPublic;
                                    commentCopy.ReferedId = comment.ReferedId;
                                    commentCopy.Save();

                                    notice.InstanceId = commentCopy.Id.ToString();
                                }
                                notice.Save();
                            }
                        }
                    }
                    else // 在自己空间内
                    {
                        if (referedComment.Id > 0 && referedComment.AuthorId != currentAccount.Id) // 为回复他人
                        {
                            CY.UME.Core.Business.Notice notice = new CY.UME.Core.Business.Notice();
                            notice.AuthorId = comment.AuthorId;
                            notice.IsReaded = false;
                            notice.DateCreated = DateTime.Now;
                            notice.Type = "inforeply";
                            notice.AccountId = referedComment.AuthorId;
                            //notice.Content = currentAccount.Name + "回复了您的留言";
                            notice.Content = "回复了您的留言";

                            // 在所引用的留言的作者处添加一条回复副本,方便其在他的个人空间内查看到
                            CY.UME.Core.Business.SpaceComment commentCopy = new CY.UME.Core.Business.SpaceComment();
                            commentCopy.AccountId = referedComment.AuthorId;
                            commentCopy.AuthorId = currentAccount.Id;
                            commentCopy.Content = comment.Content;
                            commentCopy.DateCreated = comment.DateCreated;
                            commentCopy.InstanceId = comment.InstanceId;
                            commentCopy.IP = comment.IP;
                            commentCopy.IsPublic = comment.IsPublic;
                            commentCopy.ReferedId = comment.ReferedId;
                            commentCopy.Save();

                            notice.InstanceId = commentCopy.Id.ToString();
                            notice.Save();
                        }
                    }
                }
                else if (type == "group")//群留言
                {
                    //保存留言
                    comment.AuthorId = currentAccount.Id;
                    comment.AccountId = 0;
                    comment.Content = content;
                    comment.DateCreated = DateTime.Now;
                    comment.InstanceId = group.Id;
                    comment.IP = CY.Utility.Common.RequestUtility.ClientIP;
                    comment.IsPublic = true;
                    comment.ReferedId = referedId;

                    comment.Save();

                    //保存到留言扩展信息
                    CY.UME.Core.Business.SpaceCommentExtend spaceCommentExtend = new CY.UME.Core.Business.SpaceCommentExtend();

                    spaceCommentExtend.AccountId = group.CreatorId;
                    spaceCommentExtend.Id = comment.Id;
                    spaceCommentExtend.InstanceId = group.Id.ToString();
                    spaceCommentExtend.Type = "group";

                    spaceCommentExtend.Save();

                    //留言回复通知
                    if (referedId > 0 && referedComment.AuthorId != currentAccount.Id)
                    {
                        CY.UME.Core.Business.Notice groupLeaveWordsNotice = new CY.UME.Core.Business.Notice();

                        groupLeaveWordsNotice.AccountId = referedComment.AuthorId;
                        groupLeaveWordsNotice.AuthorId = comment.AuthorId;
                        groupLeaveWordsNotice.Content = "回复了您的留言";
                        groupLeaveWordsNotice.DateCreated = DateTime.Now;
                        groupLeaveWordsNotice.InstanceId = comment.InstanceId.ToString();
                        groupLeaveWordsNotice.IsReaded = false;
                        groupLeaveWordsNotice.Type = "groupinforeply";

                        groupLeaveWordsNotice.Save();
                    }
                }
                else if (type == "active")//活动留言
                {
                    //保存留言
                    comment.AuthorId = currentAccount.Id;
                    comment.AccountId = active.Sponsor;
                    comment.Content = content;
                    comment.DateCreated = DateTime.Now;
                    comment.InstanceId = active.Id;
                    comment.IP = CY.Utility.Common.RequestUtility.ClientIP;
                    comment.IsPublic = true;
                    comment.ReferedId = referedId;

                    comment.Save();

                    //保存到留言扩展信息
                    CY.UME.Core.Business.SpaceCommentExtend spaceCommentExtend = new CY.UME.Core.Business.SpaceCommentExtend();

                    spaceCommentExtend.AccountId = active.Sponsor;
                    spaceCommentExtend.Id = comment.Id;
                    spaceCommentExtend.InstanceId = active.Id.ToString();
                    spaceCommentExtend.Type = "active";

                    spaceCommentExtend.Save();

                    //留言回复通知
                    if (referedId > 0 && referedComment.AuthorId != currentAccount.Id)
                    {
                        CY.UME.Core.Business.Notice groupLeaveWordsNotice = new CY.UME.Core.Business.Notice();

                        groupLeaveWordsNotice.AccountId = referedComment.AuthorId;
                        groupLeaveWordsNotice.AuthorId = comment.AuthorId;
                        groupLeaveWordsNotice.Content = "回复了您的留言";
                        groupLeaveWordsNotice.DateCreated = DateTime.Now;
                        groupLeaveWordsNotice.InstanceId = comment.InstanceId.ToString();
                        groupLeaveWordsNotice.IsReaded = false;
                        groupLeaveWordsNotice.Type = "activeinforeply";

                        groupLeaveWordsNotice.Save();
                    }
                }
                #endregion

                StringBuilder sb = new StringBuilder();
                sb.Append("{success:true, msg: '添加成功!', account: {");
                sb.Append("Id: " + comment.AuthorId);
                sb.Append(", Name: '");
                sb.Append(currentAccount.Name);
                sb.Append("'}, commentId: ");
                sb.Append(comment.Id);
                sb.Append("}");

                context.Response.Write(sb.ToString());
            }
            catch (Exception ex)
            {
                context.Response.Write("{success:false, msg:'添加失败!错误信息:" + CY.Utility.Common.StringUtility.RemoveIllegalCharacters(ex.Message) + "'}");
            }
        }
Example #4
0
        protected void bunSumbit_Click(object sender, EventArgs e)
        {
            #region Valid
            if (string.IsNullOrEmpty(tbName.Text.Trim()))
            {
                //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '错误', content: '活动名称不能为空'});</script>");
                base.ExecuteClientScript("$('#add_msg').html('活动名称不能为空。').fadeOut(10000, function () { $(this).html('').show(); });");
                tbName.Focus();
                return;
            }
            if (tbName.Text.Trim().Length > 20)
            {
                //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '错误', content: '活动名称不能超过20字符'});</script>");
                base.ExecuteClientScript("$('#add_msg').html('活动名称不能为空。').fadeOut(10000, function () { $(this).html('').show(); });");
                tbName.Focus();
                return;
            }
            if (string.IsNullOrEmpty(tbStartTime.Text.Trim()))
            {
                //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '错误', content: '活动起始时间不能为空'});</script>");
                base.ExecuteClientScript("$('#add_msg').html('活动起始时间不能为空。').fadeOut(10000, function () { $(this).html('').show(); });");
                tbStartTime.Focus();
                return;
            }
            if (string.IsNullOrEmpty(tbEndTime.Text.Trim()))
            {
                //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '错误', content: '活动结束时间不能为空'});</script>");
                base.ExecuteClientScript("$('#add_msg').html('活动结束时间不能为空。').fadeOut(10000, function () { $(this).html('').show(); });");
                tbEndTime.Focus();
                return;
            }
            HttpPostedFile files = Request.Files["file"];
            if (files.ContentLength > 0 && !string.IsNullOrEmpty(files.FileName))
            {
                string fileExtension = CY.Utility.Common.FileUtility.GetFileExtension(files.FileName).ToLower();
                if (fileExtension != ".jpg" && fileExtension != ".jpeg" && fileExtension != ".gif" && fileExtension != ".png" && fileExtension != ".bmp")
                {
                    //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '错误', content: '图片格式不正确,请上传图片格式'});</script>");
                    base.ExecuteClientScript("$('#add_msg').html('图片格式不正确,请重新选择图片上传。').fadeOut(10000, function () { $(this).html('').show(); });");
                    return;
                }
            }

            #endregion
            try
            {
                if (Request.QueryString["ActiveID"] == null)
                {
                    CY.UME.Core.Business.Activities activ = new CY.UME.Core.Business.Activities();
                    activ.Name = tbName.Text.Trim();//活动名称
                    if (!string.IsNullOrEmpty(tbStartTime.Text.Trim()))
                    {
                        string startH = tbStartTime.Text.Trim();
                        string startM = ddlHour.SelectedValue;
                        string startS = ddlM.SelectedValue;
                        string Time = startH + " " + startM + ":" + startS;
                        activ.StartTime = DateTime.Parse(Time);//起始时间
                    }
                    if (!string.IsNullOrEmpty(tbEndTime.Text.Trim()))
                    {
                        string endH = tbEndTime.Text.Trim();
                        string endM = ddlH2.SelectedValue;
                        string endS = ddlM2.SelectedValue;
                        string endTime = endH + " " + endM + ":" + endS;
                        activ.EndTime = DateTime.Parse(endTime);//结束时间
                    }
                    activ.Sponsor = CurrentAccount.Id;//发起人
                    activ.Overview = tbOverView.Text.Trim();//活动简介
                    //activ.Slogans = tbSlogans.Text.Trim();//活动广告语
                    activ.Type = int.Parse(ddlType.SelectedValue);//活动类型
                    activ.Address = tbAddress.Text.Trim();//活动地址
                    if (Request.QueryString["groupId"] != null)
                    {
                        activ.Organizer = CY.Utility.Common.ConvertUtility.ConvertToLong(Request.QueryString["groupId"], 0);
                    }
                    activ.Save();

                    if (files != null && files.ContentLength > 0 && !string.IsNullOrEmpty(files.FileName))
                    {
                        SaveFiles(activ.Id, activ.Name, files);
                    }
                    else
                    {
                        activ.CreateActiveAlbum();
                    }
                    /*****************************************************************************/
                    //存入参加人表
                    CY.UME.Core.Business.ActivitieParticipants ap = new CY.UME.Core.Business.ActivitieParticipants();
                    ap.ActivitieId = activ.Id;
                    ap.AccountId = CurrentAccount.Id;
                    ap.JionTime = DateTime.Now;
                    ap.Type = 1;//参加
                    ap.Save();
                    //存入感兴趣表
                    CY.UME.Core.Business.ActivitieParticipants apInterest = new CY.UME.Core.Business.ActivitieParticipants();
                    apInterest.ActivitieId = activ.Id;
                    apInterest.AccountId = CurrentAccount.Id;
                    apInterest.JionTime = DateTime.Now;
                    apInterest.Type = 2;//感兴趣
                    apInterest.Save();
                    /******************************************************************************************************/
                    //添加通知
                    //CurrentAccount.SendNoticeToAllFriend("activites", CurrentAccount.Name + "创建了新活动:" + activ.Name, activ.Id.ToString());后台加
                    //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '提示', content: '发起活动成功,等待管理员审核,跳转到活动首页'});window.location.href='ActiveDefault.aspx'</script>");
                    base.ShowAlert("提示", "发起活动成功,等待管理员审核。<span>3</span>秒后自动跳转。", true, pageName, true);
                }
                else
                {
                    int aID = CY.Utility.Common.ConvertUtility.ConvertToInt(Request.QueryString["ActiveID"], 0);
                    CY.UME.Core.Business.Activities at = CY.UME.Core.Business.Activities.Load(aID);
                    if (at != null)
                    {
                        at.Name = tbName.Text.Trim();//活动名称
                        if (!string.IsNullOrEmpty(tbStartTime.Text.Trim()))
                        {
                            string startH = tbStartTime.Text.Trim();
                            string startM = ddlHour.SelectedValue;
                            string startS = ddlM.SelectedValue;
                            string Time = startH + " " + startM + ":" + startS;
                            at.StartTime = DateTime.Parse(Time);//起始时间
                        }
                        if (!string.IsNullOrEmpty(tbEndTime.Text.Trim()))
                        {
                            string endH = tbEndTime.Text.Trim();
                            string endM = ddlH2.SelectedValue;
                            string endS = ddlM2.SelectedValue;
                            string endTime = endH + " " + endM + ":" + endS;
                            at.EndTime = DateTime.Parse(endTime);//结束时间
                        }

                        //at.Sponsor = CurrentAccount.Id;//发起人
                        at.Overview = tbOverView.Text.Trim();//活动简介
                        //at.Slogans = tbSlogans.Text.Trim();//活动广告语
                        at.Type = int.Parse(ddlType.SelectedValue);//活动类型
                        at.Address = tbAddress.Text.Trim();//活动地址
                        at.Save();
                        if (files != null && files.ContentLength > 0 && !string.IsNullOrEmpty(files.FileName))
                        {
                            if (File.Exists(Server.MapPath(at.Pic)))
                            {
                                File.Delete(Server.MapPath(at.Pic));
                            }
                            SaveFiles(at.Id, at.Name, files);
                        }
                        if (at.IsCheck)
                        {
                            //添加通知
                            //CurrentAccount.SendNoticeToAllFriend("activites", CurrentAccount.Name + "创建了新活动:" + at.Name, aID.ToString());后台加
                            //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '提示', content: '编辑活动成功,跳转到活动首页'});window.location.href='ActiveDetail2.aspx?aid=" + aID + "'</script>");
                            base.ShowAlert("提示", "编辑活动成功。<span>3</span>秒后自动跳转。请稍后。。。", true, pageName, true);
                        }
                        else
                        {
                            //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '提示', content: '修改活动成功,等待管理员审核,跳转到活动首页'});window.location.href='ActiveDefault.aspx'</script>");
                            base.ShowAlert("提示", "修改活动成功,等待管理员审核。<span>3</span>秒后自动跳转。<br/>请稍后。。。", true, pageName, true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '错误', content: '" + ex.Message + "'});</script>");
                base.ShowAlert("提示", ex.Message, false, "", true);
                return;
            }
        }
Example #5
0
        private void BindDetail(int aid)
        {
            CY.UME.Core.Business.Activities ac = CY.UME.Core.Business.Activities.Load(aid);
            if (ac != null)
            {
                active = ac;
                HotTopic.active = ac;//最热话题
                LeaveWord.activit = ac;//留言版
                member.activeID = aid;//活动成员
                meun1.ActiveID = aid;//活动菜单
                hotPicture.active = ac;//图片

                if (ac.Sponsor == CurrentAccount.Id)//发起人
                {
                    btnJoin.Visible = false;
                    //lbJoin.InnerText = "(你已参加)";
                    btnExit.Visible = false;
                    btnInterest.Visible = false;
                    btnNoInterest.Visible = false;
                }
                else//其它人
                {
                    List<CY.UME.Core.Business.ActivitieParticipants> listTT = CY.UME.Core.Business.ActivitieParticipants.GetByActiveIDandAccountID(aid, CurrentAccount.Id, 1).ToList();
                    if (listTT != null && listTT.Count > 0)
                    {
                        btnJoin.Visible = false;
                        //lbJoin.InnerText = "(你已参加)";
                        btnExit.Visible = true;//我不参加
                        btnInterest.Visible = false;
                        btnNoInterest.Visible = false;
                    }
                    else
                    {
                        List<CY.UME.Core.Business.ActivitieParticipants> listT = CY.UME.Core.Business.ActivitieParticipants.GetByActiveIDandAccountID(aid, CurrentAccount.Id, 2).ToList();
                        if (listT != null && listT.Count > 0)
                        {
                            btnInterest.Visible = false;
                            //lbInterest.InnerText = "(你感兴趣)";
                            btnNoInterest.Visible = true;//不感兴趣
                        }
                    }
                }

                ActiveID = ac.Id;
                tbAddress.Text = ac.Address;
                tbName.Text = ac.Name;
                ActiveName = ac.Name;
                SetTitle(ac.Name);
                tbStartTime.Text = ac.StartTime.ToString("yyyy年MM月dd日 HH:mm");
                tbEndTime.Text = ac.EndTime.ToString("yyyy年MM月dd日 HH:mm");
                tbType.Text = ac.TypeName;
                if (ac.Organizer == default(long))
                {
                    tbOrgin.Text = "私人举办";
                }
                else
                {
                    tbOrgin.Text = ac.OrganizerName;
                }
                if (!string.IsNullOrEmpty(ac.Pic))
                {
                    img.Src = ac.Pic;
                }
                else
                {
                    img.Src = "/Theme/default/imgs/nologo.jpg";
                }
                tbJoin.InnerText = ac.JoinMember.ToString();
                lbOverView.Text = ac.Overview;
                tbInterest.InnerText = ac.InterestMember.ToString();
                lbSlogans.Text = ac.Slogans;

                //如果活动已结束,则不显示邀请好友的菜单
                if (ac.EndTime <= DateTime.Now)
                {
                    meun1.isInventFriendBtn = false;
                }
            }
        }
Example #6
0
        //热们活动
        private void HotTop3()
        {
            //取前三条
            IEnumerable<CY.UME.Core.Business.Activities> getActivieHotList = CY.UME.Core.Business.Activities.GetHotTop4();
            ActiveList = getActivieHotList.ToList();
            if (ActiveList != null && ActiveList.Count > 0)
            {
                Top = ActiveList[0];
            }
            ActiveList.Remove(Top);
            RightControl2.activeID = Top.Id;//Me友的活动,动态获取
            if (ActiveList != null && ActiveList.Count > 0)
            {
                for (int i = 0; i < ActiveList.Count; i++)
                {
                    string pic = string.Empty;
                    if (string.IsNullOrEmpty(ActiveList[i].Pic) || ActiveList[i].Pic.Length < 1)
                        pic = "images/defaultMiddlePic.jpg";//100*100
                    else
                        pic = ActiveList[i].Pic;

                    if (i == 0)
                    {
                        HotActiveHtml.Append("<div class=\"index_bg\">");
                        HotActiveHtml.Append("<div class=\"index_tx\">");
                        HotActiveHtml.Append("<img src=\"" + pic + "\" /></div>");
                        HotActiveHtml.Append("<div class=\"index_font\">");
                        HotActiveHtml.Append("<ul>");
                        HotActiveHtml.Append("<li><a href=\"ActiveDetail2.aspx?aid=" + ActiveList[i].Id + "\">" + ActiveList[i].Name + "</a></li>");
                        HotActiveHtml.Append("<li>开始时间:" + ActiveList[i].StartTime.ToString("yyyy-MM-dd HH:mm") + "</li>");
                        HotActiveHtml.Append("<li>结束时间:" + ActiveList[i].EndTime.ToString("yyyy-MM-dd HH:mm") + "</li>");
                        HotActiveHtml.Append("<li>地点:" + ActiveList[i].Address + "</li>");
                        HotActiveHtml.Append("<li>发起人:<a target=\"_blank\" href=\"" + SiteUrl + "/Home.aspx?uid=" + ActiveList[i].Sponsor + "\">" + ActiveList[i].SponsorName + "</a></li>");
                        HotActiveHtml.Append("<li>" + ActiveList[i].JoinMember + " 人要参加<span style=\"padding-left: 15px;\">" + ActiveList[i].InterestMember + " 人感兴趣</span></li>");
                        HotActiveHtml.Append("</ul>");
                        HotActiveHtml.Append("</div>");
                        HotActiveHtml.Append("</div>");
                        HotActiveHtml.Append("<div class=\"activity_content\">");
                    }
                    else
                    {
                        HotActiveHtml.Append("<div class=\"content01\">");
                        HotActiveHtml.Append("<div class=\"left_content\">");
                        HotActiveHtml.Append("<div class=\"pic02\">");
                        HotActiveHtml.Append("<img src=\"" + pic + "\" /></div>");
                        HotActiveHtml.Append("</div>");
                        HotActiveHtml.Append("<div class=\"content03\">");
                        HotActiveHtml.Append("<ul>");
                        HotActiveHtml.Append("<li><a title=\"" + ActiveList[i].Name + "\" href=\"ActiveDetail2.aspx?aid=" + ActiveList[i].Id + "\">" + CY.Utility.Common.StringUtility.CutString(ActiveList[i].Name, 28, "...") + "</a></li>");
                        HotActiveHtml.Append("<li>开始时间:" + ActiveList[i].StartTime.ToString("yyyy-MM-dd HH:mm") + "</li>");
                        HotActiveHtml.Append("<li>结束时间:" + ActiveList[i].EndTime.ToString("yyyy-MM-dd HH:mm") + "</li>");
                        HotActiveHtml.Append("<li title=" + ActiveList[i].Address + ">地点:" + CY.Utility.Common.StringUtility.CutString(ActiveList[i].Address, 23, "...") + "</li>");
                        HotActiveHtml.Append("<li>发起人:<a target=\"_blank\" href=\"" + SiteUrl + "/Home.aspx?uid=" + ActiveList[i].Sponsor + "\">" + ActiveList[i].SponsorName + "</a></li>");
                        HotActiveHtml.Append("<li>" + ActiveList[i].JoinMember + " 人要参加<span style=\"padding-left: 15px;\">" + ActiveList[i].InterestMember + " 人感兴趣</span></li>");
                        HotActiveHtml.Append("</ul>");
                        HotActiveHtml.Append("</div>");
                        HotActiveHtml.Append("</div>");
                    }
                }
                HotActiveHtml.Append("</div>");
            }
            else
            {

            }
        }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["ActiveID"] == null)
         {
             Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('您所访问的页面不存在');window.location.href='../Login.aspx'</script>");
         }
         else
         {
             if (Request.QueryString["topicId"] != null)//编辑
             {
                 IsEdit = true;
                 Guid topicid = new Guid(Request.QueryString["topicId"].ToString());
                 ViewState["topicId"] = topicid.ToString();
                 Bind(topicid);
             }
             base.CSSName = "ume2";
             int activeID = CY.Utility.Common.ConvertUtility.ConvertToInt(Request.QueryString["ActiveID"].ToString(), 0);
             ViewState["ActiveID"] = activeID;
             member.activeID = activeID;//活动成员
             CY.UME.Core.Business.Activities active = CY.UME.Core.Business.Activities.Load(activeID);
             GlobalActive = active;
             if (active != null)
             {
                 PicTop.active = active;
                 ActiveID = active.Id;
                 ActiveName = active.Name;
                 memberInGroup.activeID = activeID;
                 InOtherActive.activeID = activeID;
                 if (active.Sponsor == CurrentAccount.Id)
                 {
                     isManage = true;
                 }
                 else { isManage = false; }
             }
             //myActive.CurentAccount = CurrentAccount;
         }
     }
     PicTop.active = GlobalActive;
     myInfo.SpaceAccount = CurrentAccount;
 }