Beispiel #1
0
        public string getGridCellText(System.Web.UI.WebControls.TableCell tc)
        {
            string cellText = "";

            if (tc.HasControls())
            {
                foreach (System.Web.UI.Control c in tc.Controls)
                {
                    if (c.GetType() == typeof(System.Web.UI.WebControls.LinkButton))
                    {
                        System.Web.UI.WebControls.LinkButton lb = c as System.Web.UI.WebControls.LinkButton;
                        cellText = lb.Text.Trim();
                    }
                    else if (c.GetType() == typeof(System.Web.UI.WebControls.HyperLink))
                    {
                        System.Web.UI.WebControls.HyperLink h1 = c as System.Web.UI.WebControls.HyperLink;
                        cellText = h1.Text.Trim();
                    }
                    else if (c.GetType() == typeof(System.Web.UI.WebControls.Label))
                    {
                        System.Web.UI.WebControls.Label lbl = c as System.Web.UI.WebControls.Label;
                        cellText = lbl.Text.Trim();
                    }
                }
            }
            else
            {
                cellText = tc.Text;
            }
            return(cellText);
        }
Beispiel #2
0
        // name of document is a link button if document is published
        public static System.Web.UI.WebControls.HyperLink namelink(object sender)
        {
            var eventlink = new System.Web.UI.WebControls.HyperLink();

            System.Web.UI.WebControls.TableCell orgLinkText = ((System.Web.UI.WebControls.TableCell)sender);
            var eventName = Convert.ToString(orgLinkText.Text);

            System.Web.UI.WebControls.TableRow nodepath = ((System.Web.UI.WebControls.TableRow)orgLinkText.Parent);
            //getting noadAlias path
            string nodeAliasPath = Convert.ToString(nodepath.Cells[1].Text);
            //getting workflow name
            var WorkFlow = WorkFlowStatusBynodeAliasPath(nodeAliasPath);

            //if workflow is published then only link will come on event name
            if (WorkFlow == SMEConstant.WORKFLOW_PUBLISHED)
            {
                eventlink = new System.Web.UI.WebControls.HyperLink()
                {
                    NavigateUrl = nodeAliasPath,
                    Text        = eventName.Length >= 80 ? eventName.Substring(0, 80) : eventName,
                    ToolTip     = eventName
                };
            }
            return(eventlink);
        }
Beispiel #3
0
        protected void savedSearchResultsRepeater_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
            {
                System.Data.DataRowView currentRow = e.Item.DataItem as System.Data.DataRowView;
                string itemLinkValue = currentRow["HitHighlightedPropertiesXml"] as string;

                System.Xml.Linq.XElement xEl            = System.Xml.Linq.XElement.Parse(itemLinkValue);
                System.Xml.Linq.XElement hhTitleElement =
                    (from node in xEl.Elements()
                     where node.Name == "HHTitle"
                     select node).FirstOrDefault();

                System.Xml.Linq.XElement hhUrlElement =
                    (from node in xEl.Elements()
                     where node.Name == "HHUrl"
                     select node).FirstOrDefault();

                string hhTitle = hhTitleElement != null ? hhTitleElement.Value : string.Empty;
                string hhUrl   = hhUrlElement != null ? hhUrlElement.Value : string.Empty;;
                string iconUrl = Microsoft.SharePoint.Publishing.Fields.LinkFieldValue.GetDefaultIconUrl(currentRow["Url"] as string, SPContext.Current.Web);

                System.Web.UI.WebControls.Image docTypeImage = e.Item.FindControl("docTypeImage") as System.Web.UI.WebControls.Image;
                if (docTypeImage != null)
                {
                    docTypeImage.ImageUrl = iconUrl;
                }

                System.Web.UI.WebControls.HyperLink titleLink = e.Item.FindControl("titleLink") as System.Web.UI.WebControls.HyperLink;
                if (titleLink != null)
                {
                    titleLink.NavigateUrl = hhUrl;
                    titleLink.Text        = hhTitle;
                }

                System.Web.UI.WebControls.CheckBox reviewedCheckBox = e.Item.FindControl("reviewedCheckBox") as System.Web.UI.WebControls.CheckBox;
                if (reviewedCheckBox != null)
                {
                    reviewedCheckBox.InputAttributes.Add("onclick",
                                                         String.Format("SaveSearchResultData({0}, {1}, {2});",
                                                                       currentRow["Id"],
                                                                       "'reviewed'",
                                                                       "$('#" + reviewedCheckBox.ClientID + "').prop('checked')")
                                                         );
                    reviewedCheckBox.Checked = (currentRow.Row.IsNull("Reviewed")) ? false: (bool)currentRow["Reviewed"];
                }

                System.Web.UI.WebControls.CheckBox includeInSetCheckBox = e.Item.FindControl("includeInSetCheckBox") as System.Web.UI.WebControls.CheckBox;
                if (includeInSetCheckBox != null)
                {
                    includeInSetCheckBox.InputAttributes.Add("onclick",
                                                             String.Format("SaveSearchResultData({0}, {1}, {2});",
                                                                           currentRow["Id"],
                                                                           "'IncludeInSet'",
                                                                           "$('#" + includeInSetCheckBox.ClientID + "').prop('checked')")
                                                             );
                    includeInSetCheckBox.Checked = (currentRow.Row.IsNull("IncludeInSet")) ? false : (bool)currentRow["IncludeInSet"];
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// 初始化此实例。
 /// </summary>
 /// <param name="PageNumberControl">用于显示页码的控件。</param>
 /// <param name="PageNumber">页码。</param>
 public PageNumberEventArgs(System.Web.UI.WebControls.HyperLink PageNumberControl, int PageNumber)
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     this._PageNumberControl = PageNumberControl;
     this.PageNumber         = PageNumber;
 }
 private void LoadData()
 {
     System.Web.UI.WebControls.HyperLink link = regionTop.FindControl("linkSystemTitle") as System.Web.UI.WebControls.HyperLink;
     if (link != null)
     {
         link.Text = PageBase.Title;
     }
 }
Beispiel #6
0
 /// <summary>
 /// 初始化此实例。
 /// </summary>
 /// <param name="ItemControl">用于显示菜单项的控件。</param>
 /// <param name="Item">正在处理的菜单项。</param>
 public ItemEventArgs(System.Web.UI.WebControls.HyperLink ItemControl, Thinksea.WebControls.Menu2.MenuItem Item)
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     this._ItemControl = ItemControl;
     this._Item        = Item;
 }
 protected override Control CreateLastPaginatorControl()
 {
     System.Web.UI.WebControls.HyperLink link = new System.Web.UI.WebControls.HyperLink();
     link.ID = "lastLink";
     link.Text = base.LastButtonText;
     link.ToolTip = base.LastButtonToolTip;
     link.NavigateUrl = this.GetLink(base.TotalPages - 1);
     return link;
 }
Beispiel #8
0
        private HyperLink AddLink(Control parent, string text, string url)
        {
            HyperLink link = new HyperLink();

            link.Text        = Server.HtmlEncode(text);
            link.NavigateUrl = url;
            parent.Controls.Add(link);
            return(link);
        }
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hyperLink = new System.Web.UI.WebControls.HyperLink {
                EnableViewState = false, EnableTheming = false
            };

            Controls.Add(_hyperLink);
        }
Beispiel #10
0
        /// <summary>
        /// HyperLink控件翻译,从数据库中取值
        /// </summary>
        /// <param name="button">要翻译的服务器控件</param>
        /// <param name="keyCode">字典键值</param>
        /// <param name="defaultText">默认值</param>
        public static void TranslationHyperLinkDB(System.Web.UI.WebControls.HyperLink button, string keyCode, string defaultText)
        {
            string tlText = string.Empty;

            tlText = Translate(keyCode);
            if (tlText == "")
            {
                tlText = defaultText;
            }
            button.Text = tlText;
        }
Beispiel #11
0
 internal static void ConfigToggleViewButton(int viewIndex, System.Web.UI.WebControls.HyperLink lnkViewMode, System.Web.UI.HtmlControls.HtmlGenericControl lblViewMode)
 {
     if (viewIndex == 0)
     {
         lnkViewMode.CssClass  = "pc-toggler-dd list-cmd shortcut";
         lblViewMode.InnerText = "常规列表";
     }
     else
     {
         lnkViewMode.CssClass  = "pc-toggler-dt list-cmd shortcut";
         lblViewMode.InnerText = "精简表格";
     }
 }
		public void InstantiateIn (System.Web.UI.Control container)
		{
			System.Web.UI.WebControls.HyperLink objButton = default(System.Web.UI.WebControls.HyperLink);

			switch (mobjTemplateType)
			{
				case System.Web.UI.WebControls.ListItemType.Item:
				case System.Web.UI.WebControls.ListItemType.AlternatingItem:
				case System.Web.UI.WebControls.ListItemType.SelectedItem:
					objButton = new System.Web.UI.WebControls.HyperLink ();
					objButton.Text = mstrCaption;
					objButton.ID = mstrID;

					container.Controls.Add (objButton);
					break;
			}
			//itemcount += 1
		}
Beispiel #13
0
 /*
  * Events
  */
 /// <summary>
 ///
 /// </summary>
 protected void InboxDataGrid_ItemDataBound(System.Object sender, System.Web.UI.WebControls.DataGridItemEventArgs args)
 {
     // TODO: change aspect of read messages
     if (args.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item)
     {
         args.Item.Attributes.Add("onmouseover", "this.className='" + this.InboxDataGrid.ItemStyle.CssClass + "H'");
         args.Item.Attributes.Add("onmouseout", "this.className='" + this.InboxDataGrid.ItemStyle.CssClass + "'");
     }
     if (args.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         args.Item.Attributes.Add("onmouseover", "this.className='" + this.InboxDataGrid.AlternatingItemStyle.CssClass + "H'");
         args.Item.Attributes.Add("onmouseout", "this.className='" + this.InboxDataGrid.AlternatingItemStyle.CssClass + "'");
     }
     System.Web.UI.WebControls.HyperLink label = (System.Web.UI.WebControls.HyperLink)(args.Item.Cells[2].FindControl("inboxItemSubjectLink"));
     if (label != null && label.Text.Length == 0)
     {
         label.Text = SharpUI.LocalizedRS.GetString("noSubject");
     }
 }
Beispiel #14
0
        /// <summary>
        ///
        /// </summary>
        private void showMessagePanel()
        {
            System.Web.UI.WebControls.RegularExpressionValidator rev = (System.Web.UI.WebControls.RegularExpressionValidator) this.SharpUI.FindControl("toemailValidator");
            rev.ValidationExpression = @"^" + anmar.SharpMimeTools.ABNF.addr_spec + @"(,\s*" + anmar.SharpMimeTools.ABNF.addr_spec + @")*$";
            this.newMessageFromPH    = (System.Web.UI.WebControls.PlaceHolder) this.SharpUI.FindControl("newMessageFromPH");

            if (!this.IsPostBack)
            {
                if (Application["sharpwebmail/send/addressbook"] != null)
                {
                    System.Collections.SortedList addressbooks = (System.Collections.SortedList)Application["sharpwebmail/send/addressbook"];
                    if (addressbooks.Count > 0)
                    {
                        System.Web.UI.WebControls.HyperLink addressbook = (System.Web.UI.WebControls.HyperLink) this.SharpUI.FindControl("newMessageWindowToEmailLabel");
                        addressbook.NavigateUrl = "javascript:window.open('addressbook.aspx', 'addressbook', 'width=400, height=400, resizable=yes, scrollbars=yes');void(true);";
                        addressbook             = (System.Web.UI.WebControls.HyperLink) this.SharpUI.FindControl("msgtoolbarAddressBook");
                        addressbook.NavigateUrl = "javascript:window.open('addressbook.aspx', 'addressbook', 'width=400, height=400, resizable=yes, scrollbars=yes');void(true);";
                        addressbook.Visible     = true;
                    }
                }
                switch ((int)Application["sharpwebmail/login/mode"])
                {
                case 2:
                    this.newMessageFromPH.Visible = true;
                    rev = (System.Web.UI.WebControls.RegularExpressionValidator) this.SharpUI.FindControl("fromemailValidator");
                    rev.ValidationExpression = "^" + anmar.SharpMimeTools.ABNF.addr_spec + "$";
                    if (this.fromemail.Value.Length == 0 && Session["DisplayEmail"] != null)
                    {
                        this.fromemail.Value = Session["DisplayEmail"].ToString();
                    }
                    break;

                case 1:
                case 3:
                default:
                    System.Web.UI.WebControls.Label newMessageWindowFromEmail = (System.Web.UI.WebControls.Label) this.SharpUI.FindControl("newMessageWindowFromEmail");
                    newMessageWindowFromEmail.Text = User.Identity.Name;
                    break;
                }
            }
            this.newMessagePH.Visible = true;
            return;
        }
Beispiel #15
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            string navigateUrl   = System.String.Empty;
            string imageUrl      = System.String.Empty;
            string alternateText = System.String.Empty;

            // If the value for the Advertisement File is not empty.
            if (this.AdvertisementFile.Length > 0)
            {
                // Get a random ad.
                GetRandomAd(out imageUrl, out navigateUrl, out alternateText);
            }

            // Create and render a new HyperLink Web control.
            System.Web.UI.WebControls.HyperLink bannerLink = new System.Web.UI.WebControls.HyperLink();
            foreach (string key in this.Attributes.Keys)
            {
                bannerLink.Attributes[key] = this.Attributes[key];
            }
            if (this.ID != null && this.ID.Length > 0)
            {
                bannerLink.ID = this.ClientID;
            }
            bannerLink.NavigateUrl = navigateUrl;
            bannerLink.Target      = this.Target;
            bannerLink.AccessKey   = this.AccessKey;
            bannerLink.Enabled     = this.Enabled;
            bannerLink.TabIndex    = this.TabIndex;
            bannerLink.RenderBeginTag(writer);

            // Create and render a new Image Web control.
            System.Web.UI.WebControls.Image bannerImage = new System.Web.UI.WebControls.Image();
            if (ControlStyleCreated)
            {
                bannerImage.ApplyStyle(this.ControlStyle);
            }
            bannerImage.AlternateText = alternateText;
            bannerImage.ImageUrl      = imageUrl;
            bannerImage.ToolTip       = this.ToolTip;
            bannerImage.RenderControl(writer);
            bannerLink.RenderEndTag(writer);
        }
Beispiel #16
0
        private void LoadData()
        {
            System.Web.UI.WebControls.HyperLink link = topPanel.FindControl("linkSystemTitle") as System.Web.UI.WebControls.HyperLink;
            if (link != null)
            {
                link.Text = ConfigHelper.Title;
            }

            btnUserName.Text = GetIdentityName();

            //TimeSpan ts = DateTime.Parse("2018-07-27") - DateTime.Now;
            //lblTime.Text = string.Format("系统试用到期时间:2018-07-27,剩余使用时间:{0}天", ts.Days);
            //if (ts.Days <= 0)
            //{
            //    FormsAuthentication.SignOut();
            //    Session.Abandon();

            //    FormsAuthentication.RedirectToLoginPage();
            //}
        }
 protected override Control[] CreateMainPaginatorControls(int fromPage, int toPage)
 {
     System.Web.UI.WebControls.HyperLink[] linkArray = new System.Web.UI.WebControls.HyperLink[toPage - fromPage];
     for (int i = 0; i < linkArray.Length; i++)
     {
         linkArray[i] = new System.Web.UI.WebControls.HyperLink();
         linkArray[i].EnableViewState = false;
         if (base.PageButtonTextFormat == null)
         {
             linkArray[i].Text = ((i + fromPage) + 1).ToString();
         }
         else
         {
             linkArray[i].Text = string.Format(base.PageButtonTextFormat, (i + fromPage) + 1);
         }
         linkArray[i].ID = (i + fromPage).ToString();
         if ((i + fromPage) != base.PageIndex)
         {
             linkArray[i].NavigateUrl = this.GetLink(i + fromPage);
         }
     }
     return linkArray;
 }
Beispiel #18
0
 private HyperLink AddLink(Control parent, string text, string url)
 {
     HyperLink link = new HyperLink();
     link.Text = Server.HtmlEncode(text);
     link.NavigateUrl = url;
     parent.Controls.Add(link);
     return link;
 }
 protected override Control CreatePreviousPaginatorControl()
 {
     System.Web.UI.WebControls.HyperLink link = new System.Web.UI.WebControls.HyperLink();
     link.ID = "previousLink";
     link.Text = base.PreviousButtonText;
     link.ToolTip = base.PreviousButtonToolTip;
     link.NavigateUrl = this.GetLink(base.PageIndex - 1);
     return link;
 }
Beispiel #20
0
        protected override void AttachChildControls()
        {
            this.calendarStartDate    = (WebCalendar)this.FindControl("calendarStartDate");
            this.calendarEndDate      = (WebCalendar)this.FindControl("calendarEndDate");
            this.hdorderId            = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdorderId");
            this.txtOrderId           = (System.Web.UI.WebControls.TextBox) this.FindControl("txtOrderId");
            this.txtProductName       = (System.Web.UI.WebControls.TextBox) this.FindControl("txtProductName");
            this.txtShipId            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtShipId");
            this.txtShipTo            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtShipTo");
            this.txtCellPhone         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtCellPhone");
            this.txtRemark            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtRemark");
            this.txtReturnRemark      = (System.Web.UI.WebControls.TextBox) this.FindControl("txtReturnRemark");
            this.txtReplaceRemark     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtReplaceRemark");
            this.dropOrderStatus      = (OrderStautsDropDownList)this.FindControl("dropOrderStatus");
            this.dropPayType          = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropPayType");
            this.btnPay               = ButtonManager.Create(this.FindControl("btnPay"));
            this.imgbtnSearch         = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch");
            this.btnOk                = ButtonManager.Create(this.FindControl("btnOk"));
            this.btnReturn            = ButtonManager.Create(this.FindControl("btnReturn"));
            this.btnReplace           = ButtonManager.Create(this.FindControl("btnReplace"));
            this.litOrderTotal        = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal");
            this.dropRefundType       = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropRefundType");
            this.dropRefundReason     = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropRefundReason");
            this.dropReturnReason     = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropReturnReason");
            this.dropReturnRefundType = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropReturnRefundType");
            this.listOrders           = (Common_OrderManage_OrderList)this.FindControl("Common_OrderManage_OrderList");
            this.pager                = (Pager)this.FindControl("pager");

            this.hlinkAllOrder    = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkAllOrder");
            this.hlinkNotPay      = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkNotPay");
            this.hlinkNotGetGoods = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkNotGetGoods");
            this.hlinkFinished    = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkFinished");

            this.hlinkRefund = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkRefund");
            this.hlinkReturn = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkReturn");

            this.dropLogisticsCompany = (LogisticsCompanyDropDownList)this.FindControl("dropLogisticsCompany");
            this.txtLogisticsId       = (System.Web.UI.WebControls.TextBox) this.FindControl("txtLogisticsId");
            this.quantityList         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("quantityList");
            this.skuIds           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("skuIds");
            this.LogisticsCompany = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("LogisticsCompany");
            this.LogisticsId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("LogisticsId");


            this.imgbtnSearch.Click       += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click);
            this.btnPay.Click             += new System.EventHandler(this.btnPay_Click);
            this.btnOk.Click              += new System.EventHandler(this.btnOk_Click);
            this.btnReturn.Click          += new System.EventHandler(this.btnReturn_Click);
            this.btnReplace.Click         += new System.EventHandler(this.btnReplace_Click);
            this.listOrders.ItemDataBound += new Common_OrderManage_OrderList.DataBindEventHandler(this.listOrders_ItemDataBound);
            this.listOrders.ItemCommand   += new Common_OrderManage_OrderList.CommandEventHandler(this.listOrders_ItemCommand);
            //this.rptOrderProducts = (VshopTemplatedRepeater)this.FindControl("rptOrderProducts");
            //物流选择绑定值
            //IList<string> list = ExpressHelper.GetAllExpressName();
            //List<ListItem> item = new List<ListItem>();
            //foreach (string s in list)
            //{
            //    item.Add(new ListItem(s, s));
            //}
            //dropLogisticsCompany.Items.AddRange(item.ToArray());

            PageTitle.AddSiteNameTitle("我的订单");
            if (!this.Page.IsPostBack)
            {
                this.OrderRefundTime = string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["OrderRefunTime"]) ? 30 : int.Parse(System.Configuration.ConfigurationManager.AppSettings["OrderRefunTime"].ToString());
                this.SetOrderStatusLink();
                this.dropPayType.DataSource     = TradeHelper.GetPaymentModes(PayApplicationType.payOnPC);
                this.dropPayType.DataTextField  = "Name";
                this.dropPayType.DataValueField = "ModeId";
                this.dropPayType.DataBind();
                this.BindOrders();
                dropLogisticsCompany.DataBind();
                BindRefundReason();
                BindReturnReason();
            }
            //this.rptOrderProducts.DataSource = ShoppingProcessor.GetOrderItems(orderId);
            //this.rptOrderProducts.DataBind();
        }
        //Getting the news from the WebSite

        public Table GenerateNewsFromWebSite()
        {
            // loading html into HtmlDocument
            var doc = new HtmlWeb().Load("http://blueoceanmi.com/newsroom");
            // walking through all nodes of interest
            var tblSection = new WebUtilities.Controls.Table
            {
                ID          = "tblNews",
                CssClass    = "newsTable",
                CellPadding = 0,
                CellSpacing = 0
            };

            var htmlNodes =
                doc.DocumentNode.SelectNodes(
                    "//div[@class='col-xs-12 col-sm-12 col-md-12 col-lg-12 shadowleft lead-news shadowbottom']");

            int cnt = 1;

            foreach (var htmlNode in
                     doc.DocumentNode.SelectNodes(
                         "//div[@class='col-xs-12 col-sm-12 col-md-12 col-lg-12 shadowleft lead-news shadowbottom']").Take(6)
                     )
            {
                HtmlNode subNode = htmlNode.ChildNodes["div"];
                if (subNode != null)
                {
                    var row  = new TableRow();
                    var cell = new TableCell
                    {
                        ID = "tdParentNews" + cnt,
                    };
                    var innerTbl = new WebUtilities.Controls.Table
                    {
                        ID          = "innerNews" + cnt,
                        CellPadding = 2,
                        CellSpacing = 2
                    };
                    var innerRow = new TableRow();

                    if (subNode.ChildNodes["a"].HasAttributes)
                    {
                        var innerCell = new TableCell
                        {
                            ID       = "cellNews" + cnt,
                            Text     = subNode.InnerText.Trim(),
                            CssClass = "newsText Color1"
                        };

                        string navURL = "";
                        if (subNode.ChildNodes["a"].Attributes["href"].Value.Contains("news-details"))
                        {
                            navURL = "http://blueoceanmi.com/" + subNode.ChildNodes["a"].Attributes["href"].Value;
                        }
                        else
                        {
                            navURL = subNode.ChildNodes["a"].Attributes["href"].Value;
                        }

                        var hl = new System.Web.UI.WebControls.HyperLink()
                        {
                            Text        = subNode.ChildNodes["a"].InnerHtml,
                            NavigateUrl = navURL,//subNode.ChildNodes["a"].Attributes["href"].Value,
                            ToolTip     = subNode.ChildNodes["a"].InnerHtml,
                            Target      = "_blank",
                            CssClass    = "newsLink"
                        };
                        innerCell.Controls.Add(hl);
                        innerCell.Font.Bold = true;
                        innerRow.Cells.Add(innerCell);
                        innerTbl.Controls.Add(innerRow);

                        var innerRow1 = new TableRow();

                        var dateNode = ReadTillTwoBr(subNode);

                        var innerCell1 = new TableCell
                        {
                            ID   = "cellNewsURLDate" + cnt,
                            Text = ReadTillTwoBr(subNode).FirstOrDefault()
                        };
                        innerCell1.Font.Bold = true;
                        innerCell1.CssClass  = "newsSubText Color2";
                        innerRow1.Cells.Add(innerCell1);
                        innerTbl.Controls.Add(innerRow1);
                    }
                    cell.Controls.Add(innerTbl);
                    row.Cells.Add(cell);
                    tblSection.Rows.Add(row);
                }
                cnt++;
            }

            if (htmlNodes.Count < 4)
            {
                var prevDoc       = new HtmlWeb().Load("http://www.blueoceanmi.com/newsroom?t=latest-news&yr=" + DateTime.Now.AddYears(-1).Year);
                var prevhtmlNodes = prevDoc.DocumentNode.SelectNodes(
                    "//div[@class='col-xs-12 col-sm-12 col-md-12 col-lg-12 shadowleft lead-news shadowbottom']");

                int innrCnt = cnt;

                foreach (var htmlNode in prevhtmlNodes.Take(6 - htmlNodes.Count))
                {
                    HtmlNode subNode = htmlNode.ChildNodes["div"];
                    if (subNode != null)
                    {
                        var row  = new TableRow();
                        var cell = new TableCell
                        {
                            ID = "tdParentNews" + innrCnt,
                        };
                        var innerTbl = new WebUtilities.Controls.Table
                        {
                            ID          = "innerNews" + innrCnt,
                            CellPadding = 2,
                            CellSpacing = 2
                        };
                        var innerRow = new TableRow();

                        if (subNode.ChildNodes["a"].HasAttributes)
                        {
                            var innerCell = new TableCell
                            {
                                ID       = "cellNews" + innrCnt,
                                Text     = subNode.InnerText.Trim(),
                                CssClass = "newsText Color1"
                            };

                            string navURL = "";
                            if (subNode.ChildNodes["a"].Attributes["href"].Value.Contains("news-details"))
                            {
                                navURL = "http://blueoceanmi.com/" + subNode.ChildNodes["a"].Attributes["href"].Value;
                            }
                            else
                            {
                                navURL = subNode.ChildNodes["a"].Attributes["href"].Value;
                            }

                            var hl = new System.Web.UI.WebControls.HyperLink()
                            {
                                Text        = subNode.ChildNodes["a"].InnerHtml,
                                NavigateUrl = navURL,//subNode.ChildNodes["a"].Attributes["href"].Value,
                                ToolTip     = subNode.ChildNodes["a"].InnerHtml,
                                Target      = "_blank",
                                CssClass    = "newsLink"
                            };
                            innerCell.Controls.Add(hl);
                            innerCell.Font.Bold = true;
                            innerRow.Cells.Add(innerCell);
                            innerTbl.Controls.Add(innerRow);

                            var innerRow1 = new TableRow();

                            var dateNode = ReadTillTwoBr(subNode);

                            var innerCell1 = new TableCell
                            {
                                ID   = "cellNewsURLDate" + innrCnt,
                                Text = ReadTillTwoBr(subNode).FirstOrDefault()
                            };
                            innerCell1.Font.Bold = true;
                            innerCell1.CssClass  = "newsSubText Color2";
                            innerRow1.Cells.Add(innerCell1);
                            innerTbl.Controls.Add(innerRow1);
                        }
                        cell.Controls.Add(innerTbl);
                        row.Cells.Add(cell);
                        tblSection.Rows.Add(row);
                    }
                    innrCnt++;
                }
            }

            return(tblSection);
        }
Beispiel #22
0
        private void BuildLinks()
        {
            //https://www.addthis.com/help/sharing-api#.Tpd1rN5T_FR

            //format
            //http://api.addthis.com/oexchange/0.8/forward/facebook/offer?url=http://addthis.com

            //list of services
            //http://www.addthis.com/services/list#.Tpd7096sc04

            var listOfServices = Settings["Services"].ToString().ToLower().Split(',');

            foreach (var service in listOfServices)
            {
                //get the page title and url
                var tp        = (CDefault)Page;
                var pageTitle = HttpUtility.HtmlEncode(tp.Title.Trim());
                var pageUrl   = "http://" + PortalAlias.HTTPAlias + Request.RawUrl;

                //we need a new hyperlink to add to the page
                var l = new System.Web.UI.WebControls.HyperLink
                {
                    NavigateUrl =
                        String.Format(
                            "http://api.addthis.com/oexchange/0.8/forward/{0}/offer?url={1}&title={2}",
                            service, HttpUtility.UrlEncode(pageUrl), pageTitle)
                };

                //substitute in the service we are sharing to, the URL of the page, our publisher ID if included in the settings

                if (Settings.Contains("Pubid"))
                {
                    l.NavigateUrl += String.Format("&pubid={0}", Settings["Pubid"]);
                }

                if (Settings.Contains("BitlyLogin") && Settings.Contains("BitlyApi"))
                {
                    l.NavigateUrl += String.Format("&shortener=bitly&bitly.login={0}&bitly.apiKey={1}", Settings["BitlyLogin"], Settings["BitlyApi"]);
                }

                if (Settings.Contains("TwitterAccount") && service == "twitter")
                {
                    l.NavigateUrl += String.Format("&via={0}", Settings["TwitterAccount"]);
                }


                //add a nofollow to the link to prevent spiders from indexing the share link
                l.Attributes.Add("rel", "nofollow");

                //add target=_blank to popup in a new window
                //TODO: make this happen in a DNN modal popup
                l.Target = "_blank";

                //setup the "text" value for the link, in the future this might be an image
                if (Settings.Contains("IconSet"))
                {
                    //get image url
                    //todo: should verify if we are SSL or not
                    //todo: don't hardcode the size in here

                    var imageUrl = String.Format("http://{0}/desktopmodules/addthis/icons/{1}/32x32/{2}.png", PortalSettings.PortalAlias.HTTPAlias, Settings["IconSet"], service);

                    l.Text = String.Format("<img src=\"{0}\" alt=\"{1}{2}\"", imageUrl, Localization.GetString("ShareWith", LocalResourceFile), service);
                }
                else
                {
                    l.Text = service;
                }


                //add the link to the placeholder
                phAddThis.Controls.Add(l);
            }
        }
Beispiel #23
0
        protected override void AddContent()
        {
            Control content = AddDiv(Body, null);
            content.ID = "Content";
            
            if (ServiceClass.Description.Length > 0)
                AddGeneric(content, "span", "service-help", ServiceClass.Description);

            Control form = AddGeneric(content, "form");
            form.ID = "TestForm";
    
            Control selectionPara = AddPara(form, null, "Select method to test: ");
    
            HtmlSelect methodSelector = new HtmlSelect();
            methodSelector.ID = "Method";
            methodSelector.Attributes.Add("onchange", "return Method_onchange(this)");

            foreach (Method method in SortedMethods)
                methodSelector.Items.Add(method.Name);
    
            selectionPara.Controls.Add(methodSelector);

            HtmlInputButton testButton = new HtmlInputButton();
            testButton.ID = "Test";
            testButton.Value = "Test";
            testButton.Attributes["onclick"] = "return Test_onclick(this)";
            testButton.Attributes["accesskey"] = "T";
            selectionPara.Controls.Add(new LiteralControl(" "));
            selectionPara.Controls.Add(testButton);

            selectionPara.Controls.Add(new LiteralControl(" "));

            HyperLink helpLink = new HyperLink();
            helpLink.Text = "Help";
            helpLink.NavigateUrl = Request.FilePath + "?help";
            selectionPara.Controls.Add(helpLink);

            Control requestPara = AddPara(form, null, "Request parameters: ");

            HtmlTextArea requestArea = new HtmlTextArea();
            requestArea.ID = "Request";
            requestArea.Rows = 10;
            requestArea.Attributes.Add("title", "Enter the array of parameters (in JSON) to send in the RPC request.");
            requestPara.Controls.Add(requestArea);
        
            Control responsePara = AddPara(form, null, "Response result/error: ");

            HtmlTextArea responseArea = new HtmlTextArea();
            responseArea.ID = "Response";
            responseArea.Rows = 10;
            responseArea.Attributes.Add("readonly", "readonly");
            responseArea.Attributes.Add("title", "The result or error object (in JSON) from the last RPC response.");
            responsePara.Controls.Add(responseArea);

            Control statsPara = AddPara(content, null, null);
            statsPara.ID = "Stats";

            Control headersPre = AddGeneric(content, "pre");
            headersPre.ID = "Headers";

            AddScriptBlockFromResource("Jayrock.json.js");

            AddScriptBlock(@"
                var callTemplates = " + BuildCallTemplatesObject() + @";
                var theForm = null;
                var nextRequestId = 0;

                Number.prototype.formatWhole = function()
                {
                    var s = this.toFixed(0).toString();
                    var groups = [];
                    while (s.length > 0)
                    {
                        groups.unshift(s.slice(-3));
                        s = s.slice(0, -3);
                    }
                    return groups.join();
                }

                window.onload = function() 
                { 
                    theForm = document.forms[0]; 
                    Method_onchange(theForm.Method); 
                }

                function Method_onchange(sender)
                {
                    theForm.Request.value = callTemplates[sender.options[sender.selectedIndex].value];
                }

                function Test_onclick(sender)
                {
                    var stats = document.getElementById('Stats');
                    setText(stats, null);

                    var headers = document.getElementById('Headers');
                    setText(headers, null);

                    var form = theForm;

                    try
                    {
                        var request = { 
                            id : ++nextRequestId, 
                            method : form.Method.value, 
                            params : theForm.Request.value };
                        
                        form.Response.value = '';
                        form.Response.className = '';
                        var response = callSync(request);
                        setText(stats, 'Time taken = ' + (response.timeTaken / 1000).toFixed(4) + ' milliseconds; Response size = ' + response.http.text.length.formatWhole() + ' char(s)');
                        setText(headers, response.http.headers);
                        if (response.error != null) throw response.error;
                        form.Response.value = JSON.stringify(response.result);
                    }
                    catch (e)
                    {
                        form.Response.className = 'error';
                        form.Response.value = JSON.stringify(e);
                        alert(e.message);
                    }
                }

                function callSync(request)
                {
                    var http = window.XMLHttpRequest ?
                        new XMLHttpRequest() :
                        new ActiveXObject('Microsoft.XMLHTTP');
                    http.open('POST', '" + Request.FilePath + @"', false);
                    http.setRequestHeader('Content-Type', 'text/plain; charset=utf-8');
                    http.setRequestHeader('X-JSON-RPC', request.method);
                    http.send('{\""id\"":' + request.id + ',\""method\"":\""' + request.method + '\"",\""params\"":' + request.params + '}');
                    if (http.status != 200)
                        throw { message : http.status + ' ' + http.statusText, toString : function() { return this.message; } };
                    var clockStart = new Date();
                    var response = JSON.parse(http.responseText);
                    response.timeTaken = (new Date()) - clockStart;
                    response.http = { text : http.responseText, headers : http.getAllResponseHeaders() };
                    return response;
                }

                function setText(e, text)
                {
                    while (e.firstChild)
                        e.removeChild(e.firstChild);

                    if (text == null) 
                        return;

                    text = text.toString();

                    if (0 === text.length) 
                        return;

                    var textNode = document.createTextNode(text);
                    e.appendChild(textNode);
                }
                ");

            base.AddContent();
        }
Beispiel #24
0
        protected override void AddContent()
        {
            Control content = AddDiv(Body, null);

            content.ID = "Content";

            if (ServiceClass.Description.Length > 0)
            {
                AddGeneric(content, "span", "service-help", ServiceClass.Description);
            }

            Control form = AddGeneric(content, "form");

            form.ID = "TestForm";

            Control selectionPara = AddPara(form, null, "Select method to test: ");

            HtmlSelect methodSelector = new HtmlSelect();

            methodSelector.ID = "Method";
            methodSelector.Attributes.Add("onchange", "return Method_onchange(this)");

            foreach (Method method in SortedMethods)
            {
                methodSelector.Items.Add(method.Name);
            }

            selectionPara.Controls.Add(methodSelector);

            HtmlInputButton testButton = new HtmlInputButton();

            testButton.ID    = "Test";
            testButton.Value = "Test";
            testButton.Attributes["onclick"]   = "return Test_onclick(this)";
            testButton.Attributes["accesskey"] = "T";
            selectionPara.Controls.Add(new LiteralControl(" "));
            selectionPara.Controls.Add(testButton);

            selectionPara.Controls.Add(new LiteralControl(" "));

            HyperLink helpLink = new HyperLink();

            helpLink.Text        = "Help";
            helpLink.NavigateUrl = Request.FilePath + "?help";
            selectionPara.Controls.Add(helpLink);

            Control requestPara = AddPara(form, null, "Request parameters: ");

            HtmlTextArea requestArea = new HtmlTextArea();

            requestArea.ID   = "Request";
            requestArea.Rows = 10;
            requestArea.Attributes.Add("title", "Enter the array of parameters (in JSON) to send in the RPC request.");
            requestPara.Controls.Add(requestArea);

            Control responsePara = AddPara(form, null, "Response result/error: ");

            HtmlTextArea responseArea = new HtmlTextArea();

            responseArea.ID   = "Response";
            responseArea.Rows = 10;
            responseArea.Attributes.Add("readonly", "readonly");
            responseArea.Attributes.Add("title", "The result or error object (in JSON) from the last RPC response.");
            responsePara.Controls.Add(responseArea);

            Control statsPara = AddPara(content, null, null);

            statsPara.ID = "Stats";

            Control headersPre = AddGeneric(content, "pre");

            headersPre.ID = "Headers";

            AddScriptBlockFromResource("Jayrock.json.js");

            AddScriptBlock(@"
                var callTemplates = " + BuildCallTemplatesObject() + @";
                var theForm = null;
                var nextRequestId = 0;

                Number.prototype.formatWhole = function()
                {
                    var s = this.toFixed(0).toString();
                    var groups = [];
                    while (s.length > 0)
                    {
                        groups.unshift(s.slice(-3));
                        s = s.slice(0, -3);
                    }
                    return groups.join();
                }

                window.onload = function() 
                { 
                    theForm = document.forms[0]; 
                    Method_onchange(theForm.Method); 
                }

                function Method_onchange(sender)
                {
                    theForm.Request.value = callTemplates[sender.options[sender.selectedIndex].value];
                }

                function Test_onclick(sender)
                {
                    var stats = document.getElementById('Stats');
                    setText(stats, null);

                    var headers = document.getElementById('Headers');
                    setText(headers, null);

                    var form = theForm;

                    try
                    {
                        var request = { 
                            id : ++nextRequestId, 
                            method : form.Method.value, 
                            params : theForm.Request.value };
                        
                        form.Response.value = '';
                        form.Response.className = '';
                        var response = callSync(request);
                        setText(stats, 'Time taken = ' + (response.timeTaken / 1000).toFixed(4) + ' milliseconds; Response size = ' + response.http.text.length.formatWhole() + ' char(s)');
                        setText(headers, response.http.headers);
                        if (response.error != null) throw response.error;
                        form.Response.value = JSON.stringify(response.result);
                    }
                    catch (e)
                    {
                        form.Response.className = 'error';
                        form.Response.value = JSON.stringify(e);
                        alert(e.message);
                    }
                }

                function callSync(request)
                {
                    var http = window.XMLHttpRequest ?
                        new XMLHttpRequest() :
                        new ActiveXObject('Microsoft.XMLHTTP');
                    http.open('POST', '" + Request.FilePath + @"', false);
                    http.setRequestHeader('Content-Type', 'text/plain; charset=utf-8');
                    http.setRequestHeader('X-JSON-RPC', request.method);
                    http.send('{\""id\"":' + request.id + ',\""method\"":\""' + request.method + '\"",\""params\"":' + request.params + '}');
                    if (http.status != 200)
                        throw { message : http.status + ' ' + http.statusText, toString : function() { return this.message; } };
                    var clockStart = new Date();
                    var response = JSON.parse(http.responseText);
                    response.timeTaken = (new Date()) - clockStart;
                    response.http = { text : http.responseText, headers : http.getAllResponseHeaders() };
                    return response;
                }

                function setText(e, text)
                {
                    while (e.firstChild)
                        e.removeChild(e.firstChild);

                    if (text == null) 
                        return;

                    text = text.toString();

                    if (0 === text.length) 
                        return;

                    var textNode = document.createTextNode(text);
                    e.appendChild(textNode);
                }
                ");

            base.AddContent();
        }
Beispiel #25
0
 private void decodeMessage( anmar.SharpMimeTools.SharpMimeMessage mm, System.Web.UI.WebControls.PlaceHolder entity )
 {
     System.String inline = System.String.Empty;
     switch ( mm.Header.TopLevelMediaType ) {
         case anmar.SharpMimeTools.MimeTopLevelMediaType.multipart:
         case anmar.SharpMimeTools.MimeTopLevelMediaType.message:
             // TODO: allow other subtypes of "message"
             // Only message/rfc822 allowed, other subtypes ignored
             if ( mm.Header.TopLevelMediaType.Equals(anmar.SharpMimeTools.MimeTopLevelMediaType.message)
                  && !mm.Header.SubType.Equals("rfc822") )
                 break;
             if ( mm.Header.SubType.Equals ("alternative") ) {
                 if ( mm.PartsCount>0 ) {
                     this.decodeMessage ( mm.GetPart(mm.PartsCount-1),
                                          entity);
                 }
             // TODO: Take into account each subtype of "multipart"
             } else if ( mm.PartsCount>0 ) {
                 System.Web.UI.WebControls.PlaceHolder nestedentity = new System.Web.UI.WebControls.PlaceHolder ();
                 System.Collections.IEnumerator enu = mm.GetEnumerator();
                 while ( enu.MoveNext() ) {
                     this.decodeMessage ((anmar.SharpMimeTools.SharpMimeMessage) enu.Current, nestedentity);
                 }
                 entity.Controls.Add (nestedentity);
             }
             break;
         case anmar.SharpMimeTools.MimeTopLevelMediaType.text:
             if ( ( mm.Disposition==null || !mm.Disposition.Equals("attachment") )
                 && ( mm.Header.SubType.Equals("plain") || mm.Header.SubType.Equals("html") ) ) {
                 System.Web.UI.WebControls.Label label = new System.Web.UI.WebControls.Label ();
                 label.Text = mm.BodyDecoded;
                 if ( mm.IsTextBrowserDisplay ) {
                     label.Text = System.Web.HttpUtility.HtmlEncode (label.Text);
                     label.Text = label.Text.Insert (0, "<pre id=\"message\">");
                     label.Text = label.Text.Insert (label.Text.Length, "</pre>");
                 } else {
                     label.CssClass = "XPFormText";
                     if ( (int)Application["sharpwebmail/read/message/sanitizer_mode"]==1 ) {
                         label.Text = anmar.SharpWebMail.BasicSanitizer.SanitizeHTML(label.Text, anmar.SharpWebMail.SanitizerMode.CommentBlocks|anmar.SharpWebMail.SanitizerMode.RemoveEvents);
                     }
                 }
                 entity.Controls.Add (label);
                 break;
             } else {
                 goto case anmar.SharpMimeTools.MimeTopLevelMediaType.application;
             }
         case anmar.SharpMimeTools.MimeTopLevelMediaType.application:
         case anmar.SharpMimeTools.MimeTopLevelMediaType.audio:
         case anmar.SharpMimeTools.MimeTopLevelMediaType.image:
         case anmar.SharpMimeTools.MimeTopLevelMediaType.video:
             System.Web.UI.WebControls.HyperLink attachment = new System.Web.UI.WebControls.HyperLink ();
             System.Web.UI.WebControls.Image image = null;
             attachment.CssClass = "XPDownload";
             if ( mm.Name!=null )
                 attachment.Text = System.String.Format ("{0} ({1} bytes)", System.IO.Path.GetFileName(mm.Name), mm.Size);
             if ( Session["sharpwebmail/read/message/temppath"]!=null ) {
                 System.String path = Session["sharpwebmail/read/message/temppath"].ToString();
                 path = System.IO.Path.Combine (path, msgid);
                 // Dump file contents
                 System.IO.FileInfo file = mm.DumpBody ( path, true );
                 if ( file!=null && file.Exists ) {
                     System.String urlstring = System.String.Format("download.aspx?msgid={0}&name={1}&i={2}",
                                                         Server.UrlEncode(msgid), Server.UrlEncode(file.Name),
                                                         inline);
                     if ( mm.Disposition!=null && mm.Disposition.Equals("inline") ) {
                         inline = "1";
                         if ( mm.Header.TopLevelMediaType.Equals(anmar.SharpMimeTools.MimeTopLevelMediaType.image)
                                 && ( mm.Header.SubType.Equals("gif") || mm.Header.SubType.Equals("jpg") || mm.Header.SubType.Equals("png")) ) {
                             image = new System.Web.UI.WebControls.Image ();
                             image.ImageUrl = urlstring;
                         }
                     }
                     attachment.NavigateUrl = urlstring;
                     attachment.Text = System.String.Format ("{0} ({1} bytes)", file.Name, file.Length);
                 }
             }
             this.readMessageWindowAttachmentsHolder.Controls.Add (attachment);
             // Display inline image
             if ( image!=null ) {
                 entity.Controls.Add (image);
             }
             break;
         default:
             break;
     }
 }
Beispiel #26
0
        protected void listOrders_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
            {
                OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus");

                System.DateTime t = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "FinishDate") == System.DBNull.Value) ? System.DateTime.Now.AddYears(-1) : ((System.DateTime)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "FinishDate"));
                string          a = "";
                if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") != null && !(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull))
                {
                    a = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway");
                }

                System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hplinkorderreview");

                System.Web.UI.HtmlControls.HtmlAnchor linkNowPay = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("hlinkPay");

                ImageLinkButton confirmOrder = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder");
                ImageLinkButton cancelOrder  = (ImageLinkButton)e.Item.FindControl("lkbtnCloseOrder");


                //ImageLinkButton refundOrder = (ImageLinkButton)e.Item.FindControl("lkbtnRefund");
                System.Web.UI.WebControls.LinkButton  refundOrder          = (System.Web.UI.WebControls.LinkButton)e.Item.FindControl("lkbtnRefund");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForRefund  = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForRefund");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForReturn  = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForReturn");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnNotPay          = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnNotPay");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForReplace = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForReplace");
                lb_refundtitle = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_refundtitle");
                System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rpProduct");
                //查看物流
                //System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("Logistics");
                if (hyperLink != null)
                {
                    hyperLink.Visible = (orderStatus == OrderStatus.Finished);
                }


                //立即付款
                linkNowPay.Visible = (orderStatus == OrderStatus.WaitBuyerPay && a != "ecdev.plugins.payment.podrequest");
                //确认收货
                confirmOrder.Visible = (orderStatus == OrderStatus.SellerAlreadySent);
                if (cancelOrder != null)
                {
                    //取消订单
                    cancelOrder.Visible = (orderStatus == OrderStatus.WaitBuyerPay);
                }
                string SourceOrderId = ((DataRowView)e.Item.DataItem).Row["SourceOrderId"].ToString();
                string orderId       = ((DataRowView)e.Item.DataItem).Row["OrderId"].ToString();
                string IsRefund      = ((DataRowView)e.Item.DataItem).Row["IsRefund"].ToString();

                //申请退款
                if (repeater != null && orderStatus == OrderStatus.BuyerAlreadyPaid)
                {
                    string PayDate = ((DataRowView)e.Item.DataItem).Row["PayDate"].ToString();
                    if (!string.IsNullOrWhiteSpace(PayDate))
                    {
                        if (Convert.ToDateTime(PayDate) > DateTime.Now.AddMinutes(-OrderRefundTime) && IsRefund == "0")//可以取消
                        {
                            refundOrder.Visible       = true;
                            refundOrder.OnClientClick = "return IsRefund('" + orderId + "','" + SourceOrderId + "')";
                        }
                    }
                }
                if (IsRefund == "1")
                {
                    this.lb_refundtitle.Visible = true;
                    this.lb_refundtitle.Text    = "退款成功";
                }
                if (IsRefund == "2")
                {
                    this.lb_refundtitle.Visible = true;
                    this.lb_refundtitle.Text    = "退款中";
                }
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                //未付款
                lkbtnNotPay.Visible = (orderStatus == OrderStatus.WaitBuyerPay);
                //退货
                //lkbtnApplyForReturn.Visible = (orderStatus == OrderStatus.Finished && t >= System.DateTime.Now.AddDays((double)(-(double)masterSettings.EndOrderDays)));

                //退款
                //lkbtnApplyForRefund.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || orderStatus == OrderStatus.SellerAlreadySent);
                //object payDate = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PayDate");
                //if (OrderInfo.IsInClearance(payDate))
                //{
                //    lkbtnApplyForReturn.Visible = true;
                //    lkbtnApplyForRefund.Visible = false;
                //}
                //换货
                //lkbtnApplyForReplace.Visible = (orderStatus == OrderStatus.Finished && t >= System.DateTime.Now.AddDays((double)(-(double)masterSettings.EndOrderDays)));

                /*1.等待买家付款(WaitBuyerPay) ->        未付款/取消
                 * 2.已付款,等待发货(BuyerAlreadyPaid) -> 退款
                 * 3.已发货(SellerAlreadySent)          ->退款,确认收货,查看物流
                 * 4.订单已完成(Finished)  -> 退货/换货 查看物流
                 */

                //
                if (repeater != null)
                {
                    if (!string.IsNullOrEmpty(orderId))
                    {
                        DataTable dt = TradeHelper.GetOrderItemThumbnailsUrl(orderId);
                        repeater.DataSource = dt;
                        repeater.DataBind();
                    }
                }
                if (orderStatus == OrderStatus.SellerAlreadySent || orderStatus == OrderStatus.Finished || orderStatus == OrderStatus.Returned || orderStatus == OrderStatus.ApplyForReplacement || orderStatus == OrderStatus.ApplyForReturns)
                {
                    //查看物流
                    //label.Visible = true;
                }
            }
        }
Beispiel #27
0
        /// <summary>
        /// 服务器控件的翻译,从数据库中取值
        /// </summary>
        /// <param name="control">要翻译的控件</param>
        /// <param name="items">二维数组型参数,第二维第一个为字典键值,第二个为默认值</param>
        public void TranControlsDB(object control, string[][] items)
        {
            switch (control.GetType().ToString())       //
            {
            case "System.Web.UI.WebControls.GridView":
                System.Web.UI.WebControls.GridView gv = (System.Web.UI.WebControls.GridView)control;
                Translation.TranslationGridViewDB(gv, items);
                break;

            case "System.Web.UI.WebControls.DataGrid":
                System.Web.UI.WebControls.DataGrid dg = (System.Web.UI.WebControls.DataGrid)control;
                Translation.TranslationDataGridDB(dg, items);
                break;

            case "System.Web.UI.WebControls.RadioButtonList":
                System.Web.UI.WebControls.RadioButtonList rbl = (System.Web.UI.WebControls.RadioButtonList)control;
                Translation.TranslationRadioButtonListDB(rbl, items);
                break;

            case "System.Web.UI.WebControls.DropDownList":
                System.Web.UI.WebControls.DropDownList ddl = (System.Web.UI.WebControls.DropDownList)control;
                Translation.TranslationDropDownListDB(ddl, items);
                break;

            case "System.Web.UI.WebControls.CheckBoxList":
                System.Web.UI.WebControls.CheckBoxList chkl = (System.Web.UI.WebControls.CheckBoxList)control;
                Translation.TranslationCheckBoxListDB(chkl, items);
                break;

            case "System.Web.UI.WebControls.Button":
                System.Web.UI.WebControls.Button button = (System.Web.UI.WebControls.Button)control;
                Translation.TranslationButtonDB(button, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.LinkButton":
                System.Web.UI.WebControls.LinkButton lbtn = (System.Web.UI.WebControls.LinkButton)control;
                Translation.TranslationLinkButtonDB(lbtn, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.ImageButton":
                System.Web.UI.WebControls.ImageButton imgBtn = (System.Web.UI.WebControls.ImageButton)control;
                Translation.TranslationImageButtonDB(imgBtn, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.HyperLink":
                System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)control;
                Translation.TranslationHyperLinkDB(hl, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.Label":
                System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)control;
                Translation.TranslationLabelDB(label, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.CheckBox":
                System.Web.UI.WebControls.CheckBox chk = (System.Web.UI.WebControls.CheckBox)control;
                Translation.TranslationCheckBoxDB(chk, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.RadioButton":
                System.Web.UI.WebControls.RadioButton rbtn = (System.Web.UI.WebControls.RadioButton)control;
                Translation.TranslationRadioButtonDB(rbtn, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.RequiredFieldValidator":
                System.Web.UI.WebControls.RequiredFieldValidator rfv = (System.Web.UI.WebControls.RequiredFieldValidator)control;
                Translation.TranslationRequiredFieldValidatorDB(rfv, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.RangeValidator":
                System.Web.UI.WebControls.RangeValidator rv = (System.Web.UI.WebControls.RangeValidator)control;
                Translation.TranslationRangeValidatorDB(rv, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.CompareValidator":
                System.Web.UI.WebControls.CompareValidator cv = (System.Web.UI.WebControls.CompareValidator)control;
                Translation.TranslationCompareValidatorDB(cv, items[0][0], items[0][1]);
                break;

            case "System.Web.UI.WebControls.RegularExpressionValidator":
                System.Web.UI.WebControls.RegularExpressionValidator rev = (System.Web.UI.WebControls.RegularExpressionValidator)control;
                Translation.TranslationRegularExpressionValidatorDB(rev, items[0][0], items[0][1]);
                break;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                Initialize();

            string[] values = Request.QueryString.GetValues("DocumentID");
            if (values == null)
                return;

            iDocumentID = System.Convert.ToInt32(values[0]);

            DAL.ConferenceDataSet.PaperListDataTable dataTableDocument;
            DAL.ConferenceDataSetTableAdapters.PaperListTableAdapter adapterDocument = new DAL.ConferenceDataSetTableAdapters.PaperListTableAdapter();
            dataTableDocument = adapterDocument.GetDataByDocumentID(iDocumentID);

            System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table();

            int iRows = dataTableDocument.Rows.Count;

            for (int i = 0; i < iRows; i++)
            {
                // System.Data.DataRow dataRow = dataTableDocument.Rows[i];
                DAL.ConferenceDataSet.PaperListRow dataRow = (DAL.ConferenceDataSet.PaperListRow)dataTableDocument.Rows[i];

                // Define a new Web Control Image
                /*System.Web.UI.WebControls.Image imgCoverImage = new System.Web.UI.WebControls.Image();
                imgCoverImage.AlternateText = dr["Title"].ToString();
                string strImageUrl = System.String.Format("~/ImageHandler.ashx?id={0}", documentIDParam);
                imgCoverImage.ImageUrl = strImageUrl;
                cellImage.Controls.Add(imgCoverImage);*/

                // Define a new Web Control Table Row
                System.Web.UI.WebControls.TableRow tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellDocumentIDLabel = new System.Web.UI.WebControls.TableCell();
                tableCellDocumentIDLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblDocumentID = new System.Web.UI.WebControls.Label();
                lblDocumentID.Text = "DocumentID";
                tableCellDocumentIDLabel.Controls.Add(lblDocumentID);
                tableRow.Cells.Add(tableCellDocumentIDLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellDocumentIDText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtDocumentID = new System.Web.UI.WebControls.TextBox();
                txtDocumentID.Text = dataRow.DocumentID.ToString();
                tableCellDocumentIDText.Controls.Add(txtDocumentID);
                tableRow.Cells.Add(tableCellDocumentIDText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellTitleLabel = new System.Web.UI.WebControls.TableCell();
                tableCellTitleLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblTitle = new System.Web.UI.WebControls.Label();
                lblTitle.Text = "Title";
                tableCellTitleLabel.Controls.Add(lblTitle);
                tableRow.Cells.Add(tableCellTitleLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellTitleText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtTitle = new System.Web.UI.WebControls.TextBox();
                txtTitle.Text = dataRow.Title.ToString();
                tableCellTitleText.Controls.Add(txtTitle);
                tableRow.Cells.Add(tableCellTitleText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellStatusTextEnLabel = new System.Web.UI.WebControls.TableCell();
                tableCellStatusTextEnLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblStatusTextEn = new System.Web.UI.WebControls.Label();
                lblStatusTextEn.Text = "StatusTextEn";
                tableCellStatusTextEnLabel.Controls.Add(lblStatusTextEn);
                tableRow.Cells.Add(tableCellStatusTextEnLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellStatusTextEnText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtStatusTextEn = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsStatusTextEnNull())
                    txtStatusTextEn.Text = dataRow.StatusTextEn.ToString();
                else
                    txtStatusTextEn.Text = "";
                tableCellStatusTextEnText.Controls.Add(txtStatusTextEn);
                tableRow.Cells.Add(tableCellStatusTextEnText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellFirstNameLabel = new System.Web.UI.WebControls.TableCell();
                tableCellFirstNameLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblFirstName = new System.Web.UI.WebControls.Label();
                lblFirstName.Text = "FirstName";
                tableCellFirstNameLabel.Controls.Add(lblFirstName);
                tableRow.Cells.Add(tableCellFirstNameLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellFirstNameText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtFirstName = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsFirstNameNull())
                    //if (!String.IsNullOrEmpty(dataRow.FirstName))
                    txtFirstName.Text = dataRow.FirstName;
                else
                    txtFirstName.Text = "";
                tableCellFirstNameText.Controls.Add(txtFirstName);
                tableRow.Cells.Add(tableCellFirstNameText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellLastNameLabel = new System.Web.UI.WebControls.TableCell();
                tableCellLastNameLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblLastName = new System.Web.UI.WebControls.Label();
                lblLastName.Text = "LastName";
                tableCellLastNameLabel.Controls.Add(lblLastName);
                tableRow.Cells.Add(tableCellLastNameLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellLastNameText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtLastName = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsLastNameNull())
                    // if (String.IsNullOrEmpty(dataRow.LastName))
                    txtLastName.Text = dataRow.LastName;
                else
                    txtLastName.Text = "";
                tableCellLastNameText.Controls.Add(txtLastName);
                tableRow.Cells.Add(tableCellLastNameText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellEmailLabel = new System.Web.UI.WebControls.TableCell();
                tableCellEmailLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblEmail = new System.Web.UI.WebControls.Label();
                lblEmail.Text = "Email";
                tableCellEmailLabel.Controls.Add(lblEmail);
                tableRow.Cells.Add(tableCellEmailLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellEmailText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtEmail = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsEmailNull())
                    // if (String.IsNullOrEmpty(dataRow.Email))
                    txtEmail.Text = dataRow.Email;
                else
                    txtEmail.Text = "";

                tableCellEmailText.Controls.Add(txtEmail);
                tableRow.Cells.Add(tableCellEmailText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellClientFileNameLabel = new System.Web.UI.WebControls.TableCell();
                tableCellClientFileNameLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblClientFileName = new System.Web.UI.WebControls.Label();
                lblClientFileName.Text = "ClientFileName";
                tableCellClientFileNameLabel.Controls.Add(lblClientFileName);
                tableRow.Cells.Add(tableCellClientFileNameLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellClientFileNameText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtClientFileName = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsClientFileNameNull())
                    // if (String.IsNullOrEmpty(dataRow.ClientFileName))
                    txtClientFileName.Text = dataRow.ClientFileName;
                else
                    txtClientFileName.Text = "";
                tableCellClientFileNameText.Controls.Add(txtClientFileName);
                tableRow.Cells.Add(tableCellClientFileNameText);

                table.Rows.Add(tableRow);

                /*				System.Web.UI.WebControls.HyperLink hlnkBookName = new System.Web.UI.WebControls.HyperLink();
                                    hlnkBookName.Text = dr["Title"].ToString();
                                    hlnkBookName.NavigateUrl = "~/BookDetails.aspx?pBookID=" + System.Convert.ToString(dr["TitleID"].ToString());
                                    cellProp.Controls.Add(hlnkBookName);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblAuthors = new System.Web.UI.WebControls.Label();
                                    lblAuthors.Text = "Authors: ";
                                    cellProp.Controls.Add(lblAuthors);

                                    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

                                    if (!(dr["Authors"] == null || dr.IsNull("Authors")))
                                    {
                                        doc.LoadXml((string)dr["Authors"]);
                                        System.Xml.XmlElement root = doc.DocumentElement;

                                        // System.Xml.XmlNode root = doc.FirstChild;

                                        //Display the contents of the child nodes.
                                        if (root.HasChildNodes)
                                            for (int iIndex = 0; iIndex < root.ChildNodes.Count; iIndex++)
                                            {
                                                System.Xml.XmlNode xmlNodeAuthor = root.ChildNodes[iIndex];

                                                System.Xml.XmlElement xmlElementAuthorID = xmlNodeAuthor["AuthorID"];
                                                System.Xml.XmlElement xmlElementAuthorName = xmlNodeAuthor["AuthorName"];

                                                System.Web.UI.WebControls.HyperLink hlnkAuthor = new System.Web.UI.WebControls.HyperLink();
                                                hlnkAuthor.Text = xmlElementAuthorName.InnerText;
                                                hlnkAuthor.NavigateUrl = "~/Author.aspx?pAuthorID=" + xmlElementAuthorID.InnerText;
                                                cellProp.Controls.Add(hlnkAuthor);

                                                cellProp.Controls.Add(new System.Web.UI.LiteralControl("&nbsp"));

                                            }
                                    }

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblTrabslator = new System.Web.UI.WebControls.Label();
                                    lblTrabslator.Text = "Translators: ";
                                    cellProp.Controls.Add(lblTrabslator);

                                    if (!(dr["Translators"] == null || dr.IsNull("Translators")))
                                    {
                                        doc.LoadXml((string)dr["Translators"]);
                                        System.Xml.XmlElement root = doc.DocumentElement;

                                        // System.Xml.XmlNode root = doc.FirstChild;

                                        //Display the contents of the child nodes.
                                        if (root.HasChildNodes)
                                            for (int iIndex = 0; iIndex < root.ChildNodes.Count; iIndex++)
                                            {
                                                System.Xml.XmlNode xmlNodeAuthor = root.ChildNodes[iIndex];

                                                System.Xml.XmlElement xmlElementAuthorID = xmlNodeAuthor["TranslatorID"];
                                                System.Xml.XmlElement xmlElementAuthorName = xmlNodeAuthor["TranslatorName"];

                                                System.Web.UI.WebControls.HyperLink hlnkAuthor = new System.Web.UI.WebControls.HyperLink();
                                                hlnkAuthor.Text = xmlElementAuthorName.InnerText;
                                                hlnkAuthor.NavigateUrl = "~/Author.aspx?pAuthorID=" + xmlElementAuthorID.InnerText;
                                                cellProp.Controls.Add(hlnkAuthor);

                                                cellProp.Controls.Add(new System.Web.UI.LiteralControl("&nbsp"));

                                            }
                                    }

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPublisher = new System.Web.UI.WebControls.Label();
                                    lblPublisher.Text = "Publisher: " + dr["Publisher"].ToString();
                                    cellProp.Controls.Add(lblPublisher);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPublishedDate = new System.Web.UI.WebControls.Label();
                                    lblPublishedDate.Text = "Published Date: " + dr["PublishedDate"].ToString();
                                    cellProp.Controls.Add(lblPublishedDate);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPrintingTimes = new System.Web.UI.WebControls.Label();
                                    lblPrintingTimes.Text = "PrintingTimes: " + dr["PrintingTimes"].ToString();
                                    cellProp.Controls.Add(lblPrintingTimes);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPages = new System.Web.UI.WebControls.Label();
                                    lblPages.Text = "Pages: " + dr["Pages"].ToString();
                                    cellProp.Controls.Add(lblPages);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblDocumentSummary = new System.Web.UI.WebControls.Label();
                                    lblDocumentSummary.Text = "DocumentSummary: " + dr["DocumentSummary"].ToString();
                                    cellProp.Controls.Add(lblDocumentSummary);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));
                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.HyperLink hlnkDownload = new System.Web.UI.WebControls.HyperLink();
                                    hlnkDownload.Text = "Download";

                                    if (!(dr["DocumentID"] == null || dr.IsNull("DocumentID")))
                                    {
                                        string strDownloadPath = System.String.Format("~/FileDownloadHandler.ashx?FileID={0}", dr["DocumentID"].ToString());
                                        hlnkDownload.NavigateUrl = strDownloadPath;
                                    }
                                    cellProp.Controls.Add(hlnkDownload);

                     */

                tableRow = new System.Web.UI.WebControls.TableRow();
                System.Web.UI.WebControls.TableCell tableCellDownloadHyperLink = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.HyperLink hlnkDownload = new System.Web.UI.WebControls.HyperLink();
                hlnkDownload.Text = "Download";
                if (/*dataRow.FileID != null &&*/ !dataRow.IsFileIDNull())
                {
                    string strDownloadPath = System.String.Format("~/FileDownloadHandler.ashx?FileID={0}", dataRow.FileID.ToString());
                    hlnkDownload.NavigateUrl = strDownloadPath;
                }
                tableCellDownloadHyperLink.Controls.Add(hlnkDownload);
                tableRow.Cells.Add(tableCellDownloadHyperLink);
                table.Rows.Add(tableRow);
            }

            pnlDocumentDetail.Controls.Add(table);
            pnlDocumentDetail.Controls.Add(new System.Web.UI.LiteralControl("<br />"));
        }