Esempio n. 1
0
        /// <summary>
        /// Renders the HTML anchor.
        /// </summary>
        /// <param name="writer">The writer.</param>
        protected virtual void RenderHtmlAnchor(HtmlTextWriter writer)
        {
            var htmlLink = new System.Web.UI.HtmlControls.HtmlAnchor
            {
                HRef      = this.Field.Content.Path,
                Target    = "_blank",
                InnerText = this.Field.Content.Name
            };

            htmlLink.RenderControl(writer);
        }
Esempio n. 2
0
 /// <summary>
 /// Renders the HTML anchor.
 /// </summary>
 /// <param name="writer">The writer.</param>
 protected virtual void RenderHtmlAnchor(HtmlTextWriter writer)
 {
     var htmlLink = new System.Web.UI.HtmlControls.HtmlAnchor
     {
         HRef = this.Field.Content.Path,
         Target = "_blank",
         InnerText = this.Field.Content.Name
     };
     htmlLink.RenderControl(writer);
 }
Esempio n. 3
0
        public void SendMessage(ref Event Calendar, ref List <Guid> relatedUserIds, string type, bool isRegisterMode, ref string message)
        {
            try
            {
                if (relatedUserIds != null && relatedUserIds.Count > 1)
                {
                    string strRenderedKnowledgeDomains = "";

                    List <Modules.CoreNetwork.Node> CalenNodesKnowledgeDomains =
                        EventsController.get_related_nodes(paramsContainer.Tenant.Id, Calendar.EventID.Value);

                    if (CalenNodesKnowledgeDomains != null && CalenNodesKnowledgeDomains.Count() != 0)
                    {
                        int Counter = 0;
                        foreach (Modules.CoreNetwork.Node CalenNode in CalenNodesKnowledgeDomains)
                        {
                            Counter++;
                            if (Counter != 1)
                            {
                                strRenderedKnowledgeDomains += " ، ";
                            }

                            System.Web.UI.HtmlControls.HtmlAnchor a = new System.Web.UI.HtmlControls.HtmlAnchor();
                            a.InnerText = CalenNode.Name;
                            a.Target    = "_blank";
                            a.HRef      = PublicConsts.get_client_url(PublicConsts.NodePage) + "/" + CalenNode.NodeID.ToString();

                            StringBuilder  SB = new StringBuilder();
                            HtmlTextWriter TW = new HtmlTextWriter(new StringWriter(SB));
                            a.RenderControl(TW);

                            strRenderedKnowledgeDomains += SB.ToString();
                        }
                    }

                    relatedUserIds.Remove(paramsContainer.CurrentUserID.Value);

                    string strTitle = "";
                    string PostFix  = "";
                    if (isRegisterMode)
                    {
                        strTitle = "ثبت " + type;
                        PostFix  = " ثبت شد";
                    }
                    else
                    {
                        strTitle = "ویرایش " + type;
                        PostFix  = " ویرایش شد ، به تغییرات اعمال شده دقت فرمایید";
                    }

                    string strMessage = "رویدادی از نوع " + "\" " + type + " \" با عنوان " + "\" " + Calendar.Title + " \"" +
                                        " برای تاریخ " + "\" " + PublicMethods.get_local_date(Calendar.BeginDate.Value) + " \"" +
                                        " شامل موضوعات : " + strRenderedKnowledgeDomains + PostFix;
                    if (string.IsNullOrEmpty(strRenderedKnowledgeDomains))
                    {
                        strMessage = "رویدادی از نوع " + "\" " + type + " \" با عنوان " + "\" " + Calendar.Title + " \"" +
                                     " برای تاریخ " + "\" " + PublicMethods.get_local_date(Calendar.BeginDate.Value) + " \"" + PostFix;
                    }
                    else
                    {
                        strMessage = "رویدادی از نوع " + "\" " + type + " \" با عنوان " + "\" " + Calendar.Title + " \"" +
                                     " برای تاریخ " + "\" " + PublicMethods.get_local_date(Calendar.BeginDate.Value) + " \"" +
                                     " شامل موضوعات : " + strRenderedKnowledgeDomains + PostFix;
                    }


                    bool result = MSGController.bulk_send_message(paramsContainer.Tenant.Id,
                                                                  paramsContainer.CurrentUserID.Value, relatedUserIds, strTitle, strMessage);
                    if (!result)
                    {
                        message = "خطا در ارسال پیام به کاربران انتخاب شده";
                    }
                }
            }
            catch (Exception ex) { message = "خطا در ارسال پیام به کاربران انتخاب شده"; }
        }