コード例 #1
0
        protected void btnReplyProductConsultation_Click(object sender, EventArgs e)
        {
            ProductConsultationInfo productConsultation = SubsiteCommentsHelper.GetProductConsultation(this.consultationId);

            if (string.IsNullOrEmpty(this.fckReplyText.Text))
            {
                productConsultation.ReplyText = null;
            }
            else
            {
                productConsultation.ReplyText = this.fckReplyText.Text;
            }
            productConsultation.ReplyUserId = new int?(HiContext.Current.User.UserId);
            productConsultation.ReplyDate   = new DateTime?(DateTime.Now);
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <ProductConsultationInfo>(productConsultation, new string[] { "Reply" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                this.ShowMsg(msg, false);
            }
            else if (SubsiteCommentsHelper.ReplyProductConsultation(productConsultation))
            {
                this.fckReplyText.Text = string.Empty;
                this.ShowMsg("成功回复了选择的商品咨询", true);
            }
            else
            {
                this.ShowMsg("回复商品咨询失败", false);
            }
        }
コード例 #2
0
ファイル: AddMyAffiche.cs プロジェクト: uvbs/eshopSanQiang
        private void btnAddAffiche_Click(object sender, System.EventArgs e)
        {
            AfficheInfo afficheInfo = new AfficheInfo();

            afficheInfo.Title     = this.txtAfficheTitle.Text.Trim();
            afficheInfo.Content   = this.fcContent.Text;
            afficheInfo.AddedDate = System.DateTime.Now;
            ValidationResults validationResults = Validation.Validate <AfficheInfo>(afficheInfo, new string[]
            {
                "ValAfficheInfo"
            });
            string text = string.Empty;

            if (!validationResults.IsValid)
            {
                foreach (ValidationResult current in (System.Collections.Generic.IEnumerable <ValidationResult>)validationResults)
                {
                    text += Formatter.FormatErrorMessage(current.Message);
                }
                this.ShowMsg(text, false);
                return;
            }
            if (SubsiteCommentsHelper.CreateAffiche(afficheInfo))
            {
                this.txtAfficheTitle.Text = string.Empty;
                this.fcContent.Text       = string.Empty;
                this.ShowMsg("成功发布了一条公告", true);
                return;
            }
            this.ShowMsg("添加公告失败", false);
        }
コード例 #3
0
ファイル: MyArticleList.cs プロジェクト: uvbs/eshopSanQiang
        private void lkbtnDeleteCheck_Click(object sender, System.EventArgs e)
        {
            System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>();
            int num = 0;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdArticleList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    num++;
                    int item = System.Convert.ToInt32(this.grdArticleList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture);
                    list.Add(item);
                }
            }
            if (num != 0)
            {
                int num2 = SubsiteCommentsHelper.DeleteArticles(list);
                this.BindSearch();
                this.ShowMsg(string.Format(System.Globalization.CultureInfo.InvariantCulture, "成功删除{0}篇文章", new object[]
                {
                    num2
                }), true);
                return;
            }
            this.ShowMsg("请先选择需要删除的文章", false);
        }
コード例 #4
0
        private void lkbtnDeleteSelect_Click(object sender, EventArgs e)
        {
            int        item     = 0;
            List <int> affiches = new List <int>();
            int        num2     = 0;

            foreach (GridViewRow row in this.grdAfficheList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if (box.Checked)
                {
                    num2++;
                    item = Convert.ToInt32(this.grdAfficheList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture);
                    affiches.Add(item);
                }
            }
            if (num2 != 0)
            {
                int num3 = SubsiteCommentsHelper.DeleteAffiches(affiches);
                this.BindAffiche();
                this.ShowMsg(string.Format(CultureInfo.InvariantCulture, "成功删除了\"{0}\"公告", new object[] { num3 }), true);
            }
            else
            {
                this.ShowMsg("请先选择要删除的公告", false);
            }
        }
コード例 #5
0
        private void grdArticleCategories_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int rowIndex               = ((GridViewRow)((Control)e.CommandSource).NamingContainer).RowIndex;
            int categoryId             = (int)this.grdArticleCategories.DataKeys[rowIndex].Value;
            int displaySequence        = int.Parse((this.grdArticleCategories.Rows[rowIndex].FindControl("lblDisplaySequence") as Literal).Text);
            int replaceCategoryId      = 0;
            int replaceDisplaySequence = 0;

            if (e.CommandName == "Fall")
            {
                if (rowIndex < (this.grdArticleCategories.Rows.Count - 1))
                {
                    replaceCategoryId      = (int)this.grdArticleCategories.DataKeys[rowIndex + 1].Value;
                    replaceDisplaySequence = int.Parse((this.grdArticleCategories.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as Literal).Text);
                }
            }
            else if ((e.CommandName == "Rise") && (rowIndex > 0))
            {
                replaceCategoryId      = (int)this.grdArticleCategories.DataKeys[rowIndex - 1].Value;
                replaceDisplaySequence = int.Parse((this.grdArticleCategories.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as Literal).Text);
            }
            if (replaceCategoryId > 0)
            {
                SubsiteCommentsHelper.SwapArticleCategorySequence(categoryId, replaceCategoryId, displaySequence, replaceDisplaySequence);
                this.BindArticleCategory();
            }
        }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!long.TryParse(this.Page.Request.QueryString["LeaveId"], out this.LeaveId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnReplyLeaveComments.Click += new EventHandler(this.btnReplyLeaveComments_Click);
         if (!this.Page.IsPostBack)
         {
             LeaveCommentInfo leaveComment = SubsiteCommentsHelper.GetLeaveComment(this.LeaveId);
             if (leaveComment == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 this.litTitle.Text    = Globals.HtmlDecode(leaveComment.Title);
                 this.litContent.Text  = Globals.HtmlDecode(leaveComment.PublishContent);
                 this.litUserName.Text = Globals.HtmlDecode(leaveComment.UserName);
             }
         }
     }
 }
コード例 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["ConsultationId"], out this.consultationId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnReplyProductConsultation.Click += new EventHandler(this.btnReplyProductConsultation_Click);
         if (!this.Page.IsPostBack)
         {
             ProductConsultationInfo productConsultation = SubsiteCommentsHelper.GetProductConsultation(this.consultationId);
             if (productConsultation == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 this.litUserName.Text         = productConsultation.UserName;
                 this.litConsultationText.Text = productConsultation.ConsultationText;
                 this.lblTime.Time             = productConsultation.ConsultationDate;
             }
         }
     }
 }
コード例 #8
0
        private void btnAddAffiche_Click(object sender, EventArgs e)
        {
            AfficheInfo info2 = new AfficheInfo();

            info2.Title     = this.txtAfficheTitle.Text.Trim();
            info2.Content   = this.fcContent.Text;
            info2.AddedDate = DateTime.Now;
            AfficheInfo       target  = info2;
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <AfficheInfo>(target, new string[] { "ValAfficheInfo" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                this.ShowMsg(msg, false);
            }
            else if (SubsiteCommentsHelper.CreateAffiche(target))
            {
                this.txtAfficheTitle.Text = string.Empty;
                this.fcContent.Text       = string.Empty;
                this.ShowMsg("成功发布了一条公告", true);
            }
            else
            {
                this.ShowMsg("添加公告失败", false);
            }
        }
コード例 #9
0
        private void grdArticleCategories_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            int rowIndex               = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex;
            int categoryId             = (int)this.grdArticleCategories.DataKeys[rowIndex].Value;
            int displaySequence        = int.Parse((this.grdArticleCategories.Rows[rowIndex].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text);
            int num                    = 0;
            int replaceDisplaySequence = 0;

            if (e.CommandName == "Fall")
            {
                if (rowIndex < this.grdArticleCategories.Rows.Count - 1)
                {
                    num = (int)this.grdArticleCategories.DataKeys[rowIndex + 1].Value;
                    replaceDisplaySequence = int.Parse((this.grdArticleCategories.Rows[rowIndex + 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text);
                }
            }
            else
            {
                if (e.CommandName == "Rise" && rowIndex > 0)
                {
                    num = (int)this.grdArticleCategories.DataKeys[rowIndex - 1].Value;
                    replaceDisplaySequence = int.Parse((this.grdArticleCategories.Rows[rowIndex - 1].FindControl("lblDisplaySequence") as System.Web.UI.WebControls.Literal).Text);
                }
            }
            if (num > 0)
            {
                SubsiteCommentsHelper.SwapArticleCategorySequence(categoryId, num, displaySequence, replaceDisplaySequence);
                this.BindArticleCategory();
            }
        }
コード例 #10
0
        private void lkbtnDeleteCheck_Click(object sender, EventArgs e)
        {
            IList <int> helps = new List <int>();
            int         num2  = 0;

            foreach (GridViewRow row in this.grdHelpList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if (box.Checked)
                {
                    num2++;
                    int item = Convert.ToInt32(this.grdHelpList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture);
                    helps.Add(item);
                }
            }
            if (num2 != 0)
            {
                int num3 = SubsiteCommentsHelper.DeleteHelps(helps);
                this.BindSearch();
                this.dropHelpCategory.DataBind();
                this.ShowMsg(string.Format(CultureInfo.InvariantCulture, "成功删除\"{0}\"篇帮助", new object[] { num3 }), true);
            }
            else
            {
                this.ShowMsg("请先选择需要删除的帮助", false);
            }
        }
コード例 #11
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.btnSubmitArticleCategory.Click += new System.EventHandler(this.btnSubmitArticleCategory_Click);
     this.btnPicDelete.Click             += new System.EventHandler(this.btnPicDelete_Click);
     if (!int.TryParse(base.Request.QueryString["CategoryId"], out this.categoryId))
     {
         base.GotoResourceNotFound();
         return;
     }
     if (!base.IsPostBack)
     {
         ArticleCategoryInfo articleCategory = SubsiteCommentsHelper.GetArticleCategory(this.categoryId);
         if (articleCategory == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         Globals.EntityCoding(articleCategory, false);
         this.txtArticleCategoryiesName.Text = articleCategory.Name;
         this.txtArticleCategoryiesDesc.Text = articleCategory.Description;
         this.imgPic.ImageUrl      = articleCategory.IconUrl;
         this.btnPicDelete.Visible = !string.IsNullOrEmpty(this.imgPic.ImageUrl);
         this.imgPic.Visible       = !string.IsNullOrEmpty(this.imgPic.ImageUrl);
     }
 }
コード例 #12
0
        private void BindData()
        {
            int num;
            ReceivedMessageQuery query2 = new ReceivedMessageQuery();

            query2.PageIndex = this.pager.PageIndex;
            query2.PageSize  = this.pager.PageSize;
            query2.SortBy    = this.messagesList.SortOrderBy;
            query2.UserName  = HiContext.Current.User.Username;
            ReceivedMessageQuery query = query2;

            if (!string.IsNullOrEmpty(base.Request.QueryString["MessageStatus"]))
            {
                query.MessageStatus           = (MessageStatus)int.Parse(base.Request.QueryString["MessageStatus"]);
                this.statusList.SelectedValue = query.MessageStatus;
            }
            if (int.TryParse(base.Request.QueryString["IsRead"], out num))
            {
                query.IsRead = new bool?(Convert.ToBoolean(num));
            }
            if (this.messagesList.SortOrder.ToLower() == "desc")
            {
                query.SortOrder = SortAction.Desc;
            }
            DbQueryResult receivedMessages = SubsiteCommentsHelper.GetReceivedMessages(query);

            this.messagesList.DataSource = receivedMessages.Data;
            this.messagesList.DataBind();
            this.pager.TotalRecords  = receivedMessages.TotalRecords;
            this.pager1.TotalRecords = receivedMessages.TotalRecords;
        }
コード例 #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.btnSubmitHelpCategory.Click += new EventHandler(this.btnSubmitHelpCategory_Click);
     this.btnPicDelete.Click          += new EventHandler(this.btnPicDelete_Click);
     if (!int.TryParse(base.Request.QueryString["CategoryId"], out this.categoryId))
     {
         base.GotoResourceNotFound();
     }
     else if (!base.IsPostBack)
     {
         HelpCategoryInfo helpCategory = SubsiteCommentsHelper.GetHelpCategory(this.categoryId);
         if (helpCategory == null)
         {
             base.GotoResourceNotFound();
         }
         else
         {
             Globals.EntityCoding(helpCategory, false);
             this.txtHelpCategoryName.Text      = helpCategory.Name;
             this.txtHelpCategoryDesc.Text      = helpCategory.Description;
             this.radioShowFooter.SelectedValue = helpCategory.IsShowFooter;
             this.imgPic.ImageUrl      = helpCategory.IconUrl;
             this.imgPic.Visible       = !string.IsNullOrEmpty(this.imgPic.ImageUrl);
             this.btnPicDelete.Visible = !string.IsNullOrEmpty(this.imgPic.ImageUrl);
         }
     }
 }
コード例 #14
0
        private void btnEditAffiche_Click(object sender, EventArgs e)
        {
            AfficheInfo target = new AfficheInfo();

            target.AfficheId = this.afficheId;
            target.Title     = this.txtAfficheTitle.Text.Trim();
            target.Content   = this.fcContent.Text;
            target.AddedDate = DateTime.Now;
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <AfficheInfo>(target, new string[] { "ValAfficheInfo" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                this.ShowMsg(msg, false);
            }
            else
            {
                target.AfficheId = this.afficheId;
                if (SubsiteCommentsHelper.UpdateAffiche(target))
                {
                    this.ShowMsg("成功修改了当前公告信息", true);
                }
                else
                {
                    this.ShowMsg("修改公告信息错误", false);
                }
            }
        }
コード例 #15
0
        private void BindHelpCategory()
        {
            IList <HelpCategoryInfo> helpCategorys = SubsiteCommentsHelper.GetHelpCategorys();

            this.grdHelpCategories.DataSource = helpCategorys;
            this.grdHelpCategories.DataBind();
        }
コード例 #16
0
        protected void btnReplyReplyReceivedMessages_Click(object sender, EventArgs e)
        {
            SendMessageInfo    target = new SendMessageInfo();
            ReceiveMessageInfo receivedMessageToAdminInfo = SubsiteCommentsHelper.GetReceivedMessageToAdminInfo(this.receiveMessageId);

            target.Title            = this.txtReplyTitle.Text;
            target.PublishContent   = this.txtContes.Text.Trim();
            target.ReceiveMessageId = new long?(this.receiveMessageId);
            target.Addresser        = HiContext.Current.User.Username;
            target.Addressee        = receivedMessageToAdminInfo.Addresser;
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <SendMessageInfo>(target, new string[] { "ValSendMessage" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                this.ShowMsg(msg, false);
            }
            else if (SubsiteCommentsHelper.ReplyMessageToAdmin(target))
            {
                this.ShowMsg("成功回复客户消息", true);
                this.BindReplyReceivedMessages();
                this.txtReplyTitle.Text = string.Empty;
                this.txtContes.Text     = string.Empty;
            }
            else
            {
                this.ShowMsg("回复客户消息失败", false);
            }
        }
コード例 #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(base.Request.QueryString["afficheId"], out this.afficheId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnEditAffiche.Click += new EventHandler(this.btnEditAffiche_Click);
         if (!this.Page.IsPostBack)
         {
             AfficheInfo affiche = SubsiteCommentsHelper.GetAffiche(this.afficheId);
             if (affiche == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 Globals.EntityCoding(affiche, false);
                 this.txtAfficheTitle.Text = affiche.Title;
                 this.fcContent.Text       = affiche.Content;
             }
         }
     }
 }
コード例 #18
0
        private void btnAddArticle_Click(object sender, System.EventArgs e)
        {
            string iconUrl = string.Empty;

            if (this.fileUpload.HasFile)
            {
                try
                {
                    iconUrl = SubsiteCommentsHelper.UploadArticleImage(this.fileUpload.PostedFile);
                }
                catch
                {
                    this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false);
                    return;
                }
            }
            ArticleInfo articleInfo = new ArticleInfo();

            if (!this.dropArticleCategory.SelectedValue.HasValue)
            {
                this.ShowMsg("请选择文章分类", false);
            }
            else
            {
                articleInfo.CategoryId      = this.dropArticleCategory.SelectedValue.Value;
                articleInfo.Title           = this.txtArticleTitle.Text.Trim();
                articleInfo.MetaDescription = this.txtMetaDescription.Text.Trim();
                articleInfo.MetaKeywords    = this.txtMetaKeywords.Text.Trim();
                articleInfo.IconUrl         = iconUrl;
                articleInfo.Description     = this.txtShortDesc.Text.Trim();
                articleInfo.Content         = this.fcContent.Text;
                articleInfo.AddedDate       = System.DateTime.Now;
                articleInfo.IsRelease       = this.ckrrelease.Checked;
                ValidationResults validationResults = Validation.Validate <ArticleInfo>(articleInfo, new string[]
                {
                    "ValArticleInfo"
                });
                string text = string.Empty;
                if (!validationResults.IsValid)
                {
                    foreach (ValidationResult current in (System.Collections.Generic.IEnumerable <ValidationResult>)validationResults)
                    {
                        text += Formatter.FormatErrorMessage(current.Message);
                    }
                    this.ShowMsg(text, false);
                    return;
                }
                if (SubsiteCommentsHelper.CreateArticle(articleInfo))
                {
                    this.txtArticleTitle.Text = string.Empty;
                    this.txtShortDesc.Text    = string.Empty;
                    this.fcContent.Text       = string.Empty;
                    this.ShowMsg("成功添加了一篇文章", true);
                    return;
                }
                this.ShowMsg("添加文章错误", false);
                return;
            }
        }
コード例 #19
0
 public override void DataBind()
 {
     this.Items.Clear();
     foreach (ArticleCategoryInfo info in SubsiteCommentsHelper.GetMainArticleCategories())
     {
         this.Items.Add(new ListItem(info.Name, info.CategoryId.ToString()));
     }
 }
コード例 #20
0
 private void AddNewCategory(HelpCategoryInfo category)
 {
     if (SubsiteCommentsHelper.CreateHelpCategory(category))
     {
         this.ShowMsg("成功添加了一个帮助分类", true);
         return;
     }
     this.ShowMsg("操作失败,未知错误", false);
 }
コード例 #21
0
 public override void DataBind()
 {
     Items.Clear();
     Items.Add(new ListItem(NullToDisplay, string.Empty));
     foreach (ArticleCategoryInfo info in SubsiteCommentsHelper.GetMainArticleCategories())
     {
         Items.Add(new ListItem(Globals.HtmlDecode(info.Name), info.CategoryId.ToString()));
     }
 }
 public override void DataBind()
 {
     this.Items.Clear();
     base.Items.Add(new ListItem(this.NullToDisplay, string.Empty));
     foreach (HelpCategoryInfo info in SubsiteCommentsHelper.GetHelpCategorys())
     {
         this.Items.Add(new ListItem(Globals.HtmlDecode(info.Name), info.CategoryId.Value.ToString()));
     }
 }
コード例 #23
0
        private void btnAddArticle_Click(object sender, EventArgs e)
        {
            string str = string.Empty;

            if (this.fileUpload.HasFile)
            {
                try
                {
                    str = SubsiteCommentsHelper.UploadArticleImage(this.fileUpload.PostedFile);
                }
                catch
                {
                    this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false);
                    return;
                }
            }
            ArticleInfo target = new ArticleInfo();

            if (this.dropArticleCategory.SelectedValue.HasValue)
            {
                target.CategoryId      = this.dropArticleCategory.SelectedValue.Value;
                target.Title           = this.txtArticleTitle.Text.Trim();
                target.MetaDescription = this.txtMetaDescription.Text.Trim();
                target.MetaKeywords    = this.txtMetaKeywords.Text.Trim();
                target.IconUrl         = str;
                target.Description     = this.txtShortDesc.Text.Trim();
                target.Content         = this.fcContent.Text;
                target.AddedDate       = DateTime.Now;
                target.IsRelease       = this.ckrrelease.Checked;
                ValidationResults results = Hishop.Components.Validation.Validation.Validate <ArticleInfo>(target, new string[] { "ValArticleInfo" });
                string            msg     = string.Empty;
                if (!results.IsValid)
                {
                    foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                    {
                        msg = msg + Formatter.FormatErrorMessage(result.Message);
                    }
                    this.ShowMsg(msg, false);
                }
                else if (SubsiteCommentsHelper.CreateArticle(target))
                {
                    this.txtArticleTitle.Text = string.Empty;
                    this.txtShortDesc.Text    = string.Empty;
                    this.fcContent.Text       = string.Empty;
                    this.ShowMsg("成功添加了一篇文章", true);
                }
                else
                {
                    this.ShowMsg("添加文章错误", false);
                }
            }
            else
            {
                this.ShowMsg("请选择文章分类", false);
            }
        }
コード例 #24
0
 private void grdAfficheList_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
 {
     if (SubsiteCommentsHelper.DeleteAffiche((int)this.grdAfficheList.DataKeys[e.RowIndex].Value))
     {
         this.BindAffiche();
         this.ShowMsg("成功删除了选择的公告", true);
         return;
     }
     this.ShowMsg("删除失败", false);
 }
コード例 #25
0
        private void SetControl(long leaveId)
        {
            LeaveCommentInfo leaveComment = SubsiteCommentsHelper.GetLeaveComment(leaveId);

            Globals.EntityCoding(leaveComment, false);
            this.litTitle.Text          = leaveComment.Title;
            this.lblUserName.Text       = leaveComment.UserName;
            this.litLeaveDate.Time      = leaveComment.PublishDate;
            this.litPublishContent.Text = leaveComment.PublishContent;
        }
コード例 #26
0
 private void grdHelpCategories_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
 {
     if (SubsiteCommentsHelper.DeleteHelpCategory((int)this.grdHelpCategories.DataKeys[e.RowIndex].Value))
     {
         this.BindHelpCategory();
         this.ShowMsg("成功删除了选择的帮助分类", true);
         return;
     }
     this.ShowMsg("未知错误", false);
 }
コード例 #27
0
 public override void DataBind()
 {
     this.Items.Clear();
     base.Items.Add(new System.Web.UI.WebControls.ListItem(this.NullToDisplay, string.Empty));
     System.Collections.Generic.IList <HelpCategoryInfo> helpCategorys = SubsiteCommentsHelper.GetHelpCategorys();
     foreach (HelpCategoryInfo current in helpCategorys)
     {
         this.Items.Add(new System.Web.UI.WebControls.ListItem(Globals.HtmlDecode(current.Name), current.CategoryId.Value.ToString()));
     }
 }
コード例 #28
0
 private void AddNewCategory(ArticleCategoryInfo category)
 {
     if (SubsiteCommentsHelper.CreateArticleCategory(category))
     {
         this.Reset();
         this.ShowMsg("成功添加了一个文章分类", true);
         return;
     }
     this.ShowMsg("未知错误", false);
 }
コード例 #29
0
 private void btnSendToRank_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.IList <MessageBoxInfo> list = new System.Collections.Generic.List <MessageBoxInfo>();
     if (this.rdoName.Checked && !string.IsNullOrEmpty(this.txtMemberNames.Text.Trim()))
     {
         string   text  = this.txtMemberNames.Text.Trim().Replace("\r\n", "\n");
         string[] array = text.Replace("\n", "*").Split(new char[]
         {
             '*'
         });
         for (int i = 0; i < array.Length; i++)
         {
             Hidistro.Membership.Context.Member member = this.GetMember(array[i]);
             if (member != null)
             {
                 list.Add(new MessageBoxInfo
                 {
                     Accepter = array[i],
                     Sernder  = Hidistro.Membership.Context.HiContext.Current.User.Username,
                     Title    = this.MessageTitle,
                     Content  = this.Content
                 });
             }
         }
         if (list.Count <= 0)
         {
             this.ShowMsg("没有要发送的对象", false);
             return;
         }
         SubsiteCommentsHelper.SendMessageToMember(list);
         this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", list.Count), true);
     }
     if (this.rdoRank.Checked)
     {
         System.Collections.Generic.IList <Hidistro.Membership.Context.Member> list2 = new System.Collections.Generic.List <Hidistro.Membership.Context.Member>();
         list2 = SubsitePromoteHelper.GetMembersByRank(this.rankList.SelectedValue);
         foreach (Hidistro.Membership.Context.Member current in list2)
         {
             list.Add(new MessageBoxInfo
             {
                 Accepter = current.Username,
                 Sernder  = Hidistro.Membership.Context.HiContext.Current.User.Username,
                 Title    = this.MessageTitle,
                 Content  = this.Content
             });
         }
         if (list.Count > 0)
         {
             SubsiteCommentsHelper.SendMessageToMember(list);
             this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", list.Count), true);
             return;
         }
         this.ShowMsg("没有要发送的对象", false);
     }
 }
コード例 #30
0
 private void btnAddArticle_Click(object sender, EventArgs e)
 {
     if (!this.dropArticleCategory.SelectedValue.HasValue)
     {
         this.ShowMsg("请选择文章分类", false);
     }
     else
     {
         ArticleInfo article = SubsiteCommentsHelper.GetArticle(this.articleId);
         if (this.fileUpload.HasFile)
         {
             try
             {
                 ResourcesHelper.DeleteImage(article.IconUrl);
                 article.IconUrl = SubsiteCommentsHelper.UploadArticleImage(this.fileUpload.PostedFile);
             }
             catch
             {
                 this.ShowMsg("图片上传失败,您选择的不是图片类型的文件,或者网站的虚拟目录没有写入文件的权限", false);
                 return;
             }
         }
         article.ArticleId       = this.articleId;
         article.CategoryId      = this.dropArticleCategory.SelectedValue.Value;
         article.Title           = this.txtArticleTitle.Text.Trim();
         article.MetaDescription = this.txtMetaDescription.Text.Trim();
         article.MetaKeywords    = this.txtMetaKeywords.Text.Trim();
         article.Description     = this.txtShortDesc.Text.Trim();
         article.Content         = this.fcContent.Text;
         article.AddedDate       = DateTime.Now;
         article.IsRelease       = this.ckrrelease.Checked;
         ValidationResults results = Hishop.Components.Validation.Validation.Validate <ArticleInfo>(article, new string[] { "ValArticleInfo" });
         string            msg     = string.Empty;
         if (results.IsValid)
         {
             if (SubsiteCommentsHelper.UpdateArticle(article))
             {
                 this.ShowMsg("已经成功修改当前文章", true);
             }
             else
             {
                 this.ShowMsg("修改文章失败", false);
             }
         }
         else
         {
             foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
             {
                 msg = msg + Formatter.FormatErrorMessage(result.Message);
             }
             this.ShowMsg(msg, false);
         }
     }
 }