private void rptRoles_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            Role role = e.Item.DataItem as Role;

            if (role != null)
            {
                HyperLink hplEdit = (HyperLink)e.Item.FindControl("hplEdit");
                Image     imgRole = (Image)e.Item.FindControl("imgRole");
                if (role.Name == "Administrator" || role.Name == "Anonymous user")
                {
                    imgRole.ImageUrl = "~/Admin/Images/lock.png";
                    hplEdit.Visible  = false;
                }
                else
                {
                    imgRole.Visible = false;
                    // HACK: as long as ~/ doesn't work properly in mono we have to use a relative path from the Controls
                    // directory due to the template construction.
                    hplEdit.NavigateUrl = String.Format("~/Admin/RoleEdit.aspx?RoleId={0}", role.Id);
                }
                // Permissions
                Label lblPermissions = (Label)e.Item.FindControl("lblPermissions");
                lblPermissions.Text = role.PermissionsString;
                // Last update
                Label lblLastUpdate = (Label)e.Item.FindControl("lblLastUpdate");
                lblLastUpdate.Text = role.UpdateTimestamp.ToString();
            }
        }
Esempio n. 2
0
 private void reDistributor_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.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litph");
         this.i++;
         this.rows = (this.pager.PageIndex - 1) * this.pager.PageSize + this.i;
         if (this.rows == 1)
         {
             literal.Text = "<img src=\"../images/0001.gif\"></img>";
             return;
         }
         if (this.rows == 2)
         {
             literal.Text = "<img src=\"../images/0002.gif\"></img>";
             return;
         }
         if (this.rows == 3)
         {
             literal.Text = "<img src=\"../images/0003.gif\"></img>";
             return;
         }
         literal.Text = (int.Parse(literal.Text) + this.rows).ToString();
     }
 }
Esempio n. 3
0
        private void repEtiqueta_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            switch (e.Item.ItemType)
            {
            case ListItemType.AlternatingItem:
            case ListItemType.Item:

                Label lblRazaoSocial = (Label)e.Item.FindControl("lblRazaoSocial");
                Label lblContato     = (Label)e.Item.FindControl("lblContato");
                Label lblEndereco    = (Label)e.Item.FindControl("lblEndereco");
                Label lblCEP         = (Label)e.Item.FindControl("lblCEP");
                Label lblCidade      = (Label)e.Item.FindControl("lblCidade");
                Label lblEstado      = (Label)e.Item.FindControl("lblEstado");

                EntTurmaEmpresa objTurmaEmpresa = ((EntTurmaEmpresa)e.Item.DataItem);

                lblRazaoSocial.Text = objTurmaEmpresa.EmpresaCadastro.RazaoSocial;
                lblContato.Text     = objTurmaEmpresa.NomeContato;
                lblEndereco.Text    = objTurmaEmpresa.EnderecoContato;
                lblCEP.Text         = objTurmaEmpresa.CEPContato;
                lblCidade.Text      = objTurmaEmpresa.CidadeContato.Cidade;
                lblEstado.Text      = objTurmaEmpresa.EstadoContato.Sigla;

                break;
            }
        }
Esempio n. 4
0
        /*
         * /// <summary>
         * /// 显示区域图
         * /// </summary>
         * private void LoadChartDtl()
         * {
         *      try
         *      {
         *              string WBSCode = this.txtWBSCode.Value;
         *
         *              DataTable tb = new DataTable();
         *              tb.Columns.Add("WBSCode");
         *              tb.Columns.Add("TaskName");
         *              tb.Columns.Add("AttachMentCode");
         *              tb.Columns.Add("ImageName");
         *              tb.Columns.Add("ChildWBSCode");
         *              tb.Columns.Add("ChildTaskName");
         *              tb.Columns.Add("ChildStatus", typeof(int));
         *              tb.Columns.Add("ChildCompletePercent", typeof(int));
         *
         *              tb.Columns.Add("ObjectX", typeof(int));
         *              tb.Columns.Add("ObjectY", typeof(int));
         *
         *              int defaultX = 20;
         *              int defaultY = 20;
         *
         *              //第1级工作子项为区域名称
         *              EntityData entity = DAL.EntityDAO.WBSDAO.GetChildTask(WBSCode);
         *              foreach(DataRow dr in entity.CurrentTable.Rows)
         *              {
         *                      string aWBSCode = dr["WBSCode"].ToString();
         *
         *                      DataRow drNew = tb.NewRow();
         *
         *                      drNew["WBSCode"] = dr["WBSCode"];
         *                      drNew["TaskName"] = dr["TaskName"];
         *
         *                      //取区域的当前阶段
         *                      DataRow drCurr = GetCurrentState(aWBSCode);
         *                      if (drCurr != null)
         *                      {
         *                              string bWBSCode = drCurr["WBSCode"].ToString();
         *
         *                              drNew["ChildWBSCode"] = drCurr["WBSCode"];
         *                              drNew["ChildTaskName"] = drCurr["TaskName"];
         *                              drNew["ChildStatus"] = drCurr["Status"];
         *                              drNew["ChildCompletePercent"] = drCurr["CompletePercent"];
         *
         *                              //取图片
         *                              EntityData entityAttach = DAL.EntityDAO.WBSDAO.GetAttachMentByMasterCode("GroundWork", bWBSCode);
         *                              if (entityAttach.HasRecord())
         *                              {
         *                                      drNew["AttachMentCode"] = entityAttach.GetString("AttachMentCode");
         *                                      drNew["ImageName"] = entityAttach.GetString("FileName");
         *                              }
         *                              entityAttach.Dispose();
         *                      }
         *
         *                      int x = 0;
         *                      int y = 0;
         *
         *                      //取区域的位置
         *                      EntityData entityG = DAL.EntityDAO.ConstructDAO.GetGroundWorkByWBSCode(aWBSCode);
         *                      if (entityG.HasRecord())
         *                      {
         *                              x = entityG.GetInt("ObjectX");
         *                              y = entityG.GetInt("ObjectY");
         *                      }
         *                      else
         *                      {
         *                              //生成缺省位置
         *                              x = defaultX;
         *                              y = defaultY;
         *
         *                              defaultX = x;
         *                              defaultY = y + 40;
         *                      }
         *                      entityG.Dispose();
         *
         *                      drNew["ObjectX"] = x;
         *                      drNew["ObjectY"] = y;
         *
         *                      tb.Rows.Add(drNew);
         *              }
         *              entity.Dispose();
         *
         *              this.dgList.DataSource = tb;
         *              this.dgList.DataBind();
         *
         *              this.dgList2.DataSource = tb;
         *              this.dgList2.DataBind();
         *      }
         *      catch (Exception ex)
         *      {
         *              ApplicationLog.WriteLog(this.ToString(),ex,"");
         *              Response.Write(Rms.Web.JavaScript.Alert(true, "显示列表出错:" + ex.Message));
         *      }
         * }
         *
         * /// <summary>
         * /// 取区域的当前阶段
         * /// </summary>
         * /// <param name="WBSCode"></param>
         * /// <returns></returns>
         * private DataRow GetCurrentState(string WBSCode)
         * {
         *      try
         *      {
         *              DataRow dr = null;
         *
         *              //取所有子项,倒排序
         *              EntityData entityB = DAL.EntityDAO.WBSDAO.GetChildTask(WBSCode);
         *              DataView dvB = new DataView(entityB.CurrentTable, "", "SortID desc", DataViewRowState.CurrentRows);
         *
         *              //取最后一条进行中的子项作为当前状态项
         *              foreach(DataRow drB in entityB.CurrentTable.Rows)
         *              {
         *                      string bWBSCode = drB["WBSCode"].ToString();
         *
         *                      int Status = BLL.ConvertRule.ToInt(drB["Status"]);
         *                      int CompletePercent = BLL.ConvertRule.ToInt(drB["CompletePercent"]);
         *
         *                      if ((Status == 1) || (Status == 4))
         *                      {
         *                              dr = drB;
         *                              return dr;
         *                      }
         *              }
         *              entityB.Dispose();
         *
         *              return dr;
         *      }
         *      catch(Exception ex)
         *      {
         *              throw ex;
         *      }
         * }
         */

        private void dgList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            try
            {
                string AttachMentCode = ((HtmlInputHidden)e.Item.FindControl("txtAttachMentCode")).Value;
                string Color          = ((HtmlInputHidden)e.Item.FindControl("txtColor")).Value;

                HtmlImage img = (HtmlImage)e.Item.FindControl("imgItem");

                if (AttachMentCode != "")
                {
                    img.Src = "../Project/ShowAttachPicture.aspx?AttachMentCode=" + AttachMentCode;
                    img.Style["background-color"] = Color;
                    img.Style["display"]          = "";
                }
                else
                {
                    img.Style["display"] = "none";
                }
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示列表出错:" + ex.Message));
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Handles the ItemDataBound event of the rLocations control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param>
        protected void rLocations_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            object locationDataItem = e.Item.DataItem;

            if (locationDataItem != null)
            {
                var lbOpen   = e.Item.FindControl("lbOpen") as LinkButton;
                var lbClose  = e.Item.FindControl("lbClose") as LinkButton;
                var isActive = (bool)locationDataItem.GetPropertyValue("IsActive");

                if (isActive)
                {
                    lbClose.RemoveCssClass("btn-danger");
                    lbClose.RemoveCssClass("active");
                    lbOpen.AddCssClass("btn-success");
                    lbOpen.AddCssClass("active");
                }
                else
                {
                    lbOpen.RemoveCssClass("btn-success");
                    lbOpen.RemoveCssClass("active");
                    lbClose.AddCssClass("btn-danger");
                    lbClose.AddCssClass("active");
                }

                var lLocationName = e.Item.FindControl("lLocationName") as Literal;
                lLocationName.Text = locationDataItem.GetPropertyValue("Name") as string;

                var lLocationCount = e.Item.FindControl("lLocationCount") as Literal;
                lLocationCount.Text = KioskLocationAttendance.Read((int)locationDataItem.GetPropertyValue("LocationId")).CurrentCount.ToString();
            }
        }
        protected void rptLanguages_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Item node = (Item)e.Item.DataItem;

                HyperLink LangLink = (HyperLink)e.Item.FindControl("LangLink");
                System.Web.UI.WebControls.Image LangImage = (System.Web.UI.WebControls.Image)e.Item.FindControl("LangImage");
                Literal LangIso = (Literal)e.Item.FindControl("LangIso");

                //check if context item has a language version
                Item contextItem    = Sitecore.Context.Item;
                Item itemInLanguage = Sitecore.Context.Database.GetItem(contextItem.ID, Sitecore.Globalization.Language.Parse(node.Name));

                if (node != null && SiteConfiguration.DoesItemExistInCurrentLanguage(itemInLanguage) && LangLink != null && LangImage != null && LangIso != null)
                {
                    string icon = node.Appearance.Icon;
                    icon = Sitecore.Resources.Images.GetThemedImageSource(icon);
                    LangImage.ImageUrl   = icon;
                    LangIso.Text         = node["iso"].ToLower();
                    LangLink.NavigateUrl = Configuration.SiteUI.Translation.SiteLanguage.GetLanguageUrl(node);

                    if (!multipleLanguagesHasBeenProcessed)
                    {
                        LiLanguages.Attributes.Add("class", "dropdown");
                        LanguageLink.Text += " <b class=\"caret\"></b>";
                        multipleLanguagesHasBeenProcessed = true;
                    }
                }
            }
        }
Esempio n. 7
0
        private void Repeater1_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView Dr         = (DataRowView)e.Item.DataItem;
                string      StringHtml = string.Empty;
                if (this.vvf != string.Empty)
                {
                    StringHtml += "<td><b>Numero Fascicolo: </b>" + Dr["var_afm_dwgs_n_fascicolo_vvf"] + "</td>\n";
                    StringHtml += "<td><b>Data Parere Favorevole: </b>" + Dr["var_afm_dwgs_data_p_fav"] + "</td>\n";
                    if (Convert.ToInt32(Dr["var_afm_dwgs_collaudo"].ToString()) == 1)
                    {
                        StringHtml += "<td><b>Collaudo: </b>SI</td>";
                    }
                    else
                    {
                        StringHtml += "<td><b>Collaudo: </b>NO</td>";
                    }
                }

                if (this.ispesl != string.Empty)
                {
                    StringHtml += "<td><b>Numero Matricola: </b>" + Dr["var_afm_dwgs_matricola_ispesl"] + "</td>\n";
                    StringHtml += "<td><b>Data Prima Verifica: </b>" + Dr["var_afm_dwgs_data_p_ver"] + "</td>\n";
                    StringHtml += "<td><b>Anno Scadenza: </b>" + Dr["var_afm_dwgs_anno_scadenza"] + "</td>\n";
                }
                ((Literal)e.Item.FindControl("lite")).Text = StringHtml;
            }
        }
Esempio n. 8
0
        void ForumBody_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            var myContent = (Content)e.Item.DataItem;

            var browseLink = e.Item.FindControl("BrowseLink") as ActionLinkButton;
            var numLabel   = e.Item.FindControl("PostNum") as ASP.Label;
            var dateLabel  = e.Item.FindControl("PostDate") as ASP.Label;

            if (browseLink != null)
            {
                browseLink.ActionName = "Browse";
                browseLink.NodePath   = myContent.Path;
                browseLink.Text       = HttpUtility.HtmlEncode(myContent.DisplayName);
            }

            if (numLabel != null)
            {
                numLabel.Text = myContent.ContentHandler.PhysicalChildArray.Count().ToString();
            }

            if (dateLabel != null)
            {
                var oldest = myContent.ContentHandler.PhysicalChildArray.OrderBy(n => n.CreationDate).FirstOrDefault();
                if (oldest == null)
                {
                    oldest = myContent.ContentHandler;
                }

                dateLabel.Text = oldest.CreationDate.ToString();
            }
        }
Esempio n. 9
0
        protected void rptFutureMeetings_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                try
                {
                    Item nodeItm = (Item)e.Item.DataItem;

                    Literal litFutureMeetingDate     = (Literal)e.Item.FindControl("litFutureMeetingDate");
                    Literal litFutureMeetingTime     = (Literal)e.Item.FindControl("litFutureMeetingTime");
                    Literal litFutureMeetingLocation = (Literal)e.Item.FindControl("litFutureMeetingLocation");

                    if (nodeItm.Fields["Meeting Date"].Value != "")
                    {
                        litFutureMeetingDate.Text = DateUtil.ParseDateTime(nodeItm.Fields["Meeting Date"].Value.ToString(), DateTime.MaxValue).ToString("D");
                    }

                    if (nodeItm.Fields["Meeting Time"].Value != "")
                    {
                        litFutureMeetingTime.Text = nodeItm.Fields["Meeting Time"].Value.ToString();
                    }

                    if (nodeItm.Fields["Location"].Value != "")
                    {
                        litFutureMeetingLocation.Text = nodeItm.Fields["Location"].Value.ToString();
                    }
                }
                catch (Exception ex)
                {
                    bool exHandled = handleException(ex);
                }
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Handles the ItemDataBound event of the rptReleaseNotes control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param>
        protected void rptReleaseNotes_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Literal it = (Literal)e.Item.FindControl("IssueType");
                IssueType issueType = (IssueType)e.Item.DataItem;
                it.Text = issueType.Name;

                List<QueryClause> queryClauses = new List<QueryClause>();
                int MilestoneId = Convert.ToInt32(Request.QueryString["m"]);

                Repeater list = (Repeater)e.Item.FindControl("IssuesList");
                queryClauses.Add( new QueryClause("AND", "IssueTypeId", "=", issueType.Id.ToString(), SqlDbType.Int, false));
                queryClauses.Add(new QueryClause("AND", "IssueMilestoneId", "=", MilestoneId.ToString(), SqlDbType.Int, false));

                List<Status> openStatus = Status.GetStatusByProjectId(ProjectId).FindAll(s => !s.IsClosedState);
                foreach (Status st in openStatus)
                {
                    queryClauses.Add(new QueryClause("AND", "IssueStatusId", "<>", st.Id.ToString(), SqlDbType.Int, false));
                }

                List<Issue> issueList = Issue.PerformQuery(ProjectId, queryClauses);
                if (issueList.Count > 0)
                {
                    list.DataSource = issueList;
                    list.DataBind();
                }
                else
                {
                    e.Item.Visible = false;
                }
            }
        }
Esempio n. 11
0
        protected void uiRepeaterResults_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView row = (DataRowView)e.Item.DataItem;
                Label cityname = (Label)e.Item.FindControl("uiLabelCityName");

                Cities city = new Cities();
                city.LoadByPrimaryKey(Convert.ToInt32(row["CityID"].ToString()));

                cityname.Text = city.ArName;

                HyperLink linkName = (HyperLink)e.Item.FindControl("CompanyLink");
                linkName.NavigateUrl = "CompanyProfile.aspx?cid=" + row["CompanyID"].ToString();
                System.Web.UI.HtmlControls.HtmlGenericControl Name = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("CompanyName");

                if (!string.IsNullOrEmpty(row["PackageTypeID"].ToString()) && row["PackageTypeID"].ToString() != "1")
                {
                    linkName.Visible = true;
                    Name.Visible = false;
                }
                else
                {
                    linkName.Visible = false;
                    Name.Visible = true;
                }
            }
        }
        protected void rptItems_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
              {
            Item node = (Item)e.Item.DataItem;
            {
              FieldRenderer LinkText = (FieldRenderer)e.Item.FindControl("LinkText");
              FieldRenderer Title = (FieldRenderer)e.Item.FindControl("Title");
              FieldRenderer Caption = (FieldRenderer)e.Item.FindControl("Caption");
              FieldRenderer CarouselImage = (FieldRenderer)e.Item.FindControl("CarouselImage");
              HyperLink TextLink = (HyperLink)e.Item.FindControl("TextLink");
              HyperLink ImgLink = (HyperLink)e.Item.FindControl("ImgLink");
              EditFrame LinkFrame = (EditFrame)e.Item.FindControl("LinkFrame");

              if (LinkText != null && Caption != null && CarouselImage != null && TextLink != null && ImgLink != null && LinkFrame != null && Title != null)
              {
            LinkText.Item = node;
            Title.Item = node;
            Caption.Item = node;
            CarouselImage.Item = node;

            LinkFrame.Buttons = "/sitecore/content/Applications/WebEdit/Edit Frame Buttons/Carousel Items";
            LinkFrame.DataSource = node.Paths.FullPath;

            Item targetItem = Sitecore.Context.Database.GetItem(new ID(node["Link Item"]));
            if (targetItem != null)
            {
              TextLink.NavigateUrl = LinkManager.GetItemUrl(targetItem);
              ImgLink.NavigateUrl = LinkManager.GetItemUrl(targetItem);
            }
              }
            }
              }
        }
        protected void Repeater_AllJobByAllSector_DataBound(object sender, RepeaterItemEventArgs e)
        {
            Label lbl_Title = (Label)e.Item.FindControl("lbl_Title");
            lbl_Title.Text = DataBinder.Eval(e.Item.DataItem, "jTitle_en").ToString();
            lbl_Title.ToolTip = DataBinder.Eval(e.Item.DataItem, "jTitle_en").ToString();

            Label lbl_ClosingDate = (Label)e.Item.FindControl("lbl_ClosingDate");
            lbl_ClosingDate.Text = DataBinder.Eval(e.Item.DataItem, "jClosingDate", "{0:MMM} {0:dd}, {0:yyyy}");

            Label lbl_Salary = (Label)e.Item.FindControl("lbl_Salary");
            string salaryType = DataBinder.Eval(e.Item.DataItem, "jSalaryType").ToString();
            if (salaryType != "True")
            {
                lbl_Salary.Text = "Negotiable";
            }
            else
            {
                string sfrom = DataBinder.Eval(e.Item.DataItem, "jSalary_en").ToString();
                string sto = DataBinder.Eval(e.Item.DataItem, "jSalaryTo_en").ToString();
                string scurrency = DataBinder.Eval(e.Item.DataItem, "jSalaryCurrency").ToString();
                string spaymenttype = DataBinder.Eval(e.Item.DataItem, "jSalaryPaymentType").ToString();

                lbl_Salary.Text = String.Format("{0} - {1} {2}/{3}", sfrom, sto, scurrency, spaymenttype);
            }
        }
        protected void repNoImageListing_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                ProductEntity pe = e.Item.DataItem as ProductEntity;
                Literal litPriceInformation = e.Item.FindControl("litPriceInformation") as Literal;
                string priceString = (pe.PriceIsFrom) ? "from " : string.Empty;
                priceString = priceString + "&pound;" + pe.Price.ToString("f");
                priceString = (pe.PriceIncludesVat) ? priceString + " inc VAT" : priceString + " ex VAT";
                litPriceInformation.Text = priceString;

                Literal litDeliveryPrice = e.Item.FindControl("litDeliveryPrice") as Literal;
                string deliveryPriceString = (pe.DeliveryPrice > 0) ? " Delivery: " + pe.DeliveryPrice.ToString("f") : string.Empty;
                litDeliveryPrice.Text = deliveryPriceString;

                if (!m_ShowDescription)
                {
                    e.Item.FindControl("descriptionField").Visible = false;
                }

                if (e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    HtmlTableRow row = e.Item.FindControl("gridRow") as HtmlTableRow;
                    row.Attributes.Add("class", "alternate");
                }
            }
            else if (e.Item.ItemType == ListItemType.Header)
            {
                if (!m_ShowDescription)
                {
                    e.Item.FindControl("descriptionHead").Visible = false;
                }
            }
        }
        protected void rptRelatedNews_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int ncat = ConvertData.ConvertToInt(Request.QueryString["ncat"]);
            if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
            {
                HyperLink lnkTitleRelated = (HyperLink)e.Item.FindControl("lnkTitleRelated");
                Label lblDate = (Label)e.Item.FindControl("lblDate");
                int nID = ConvertData.ConvertToInt(DataBinder.Eval(e.Item.DataItem, "ProductID"));
                string sTitle = ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "ProductName"));
                string sUrl = Constants.ROOT + "Thongtin.aspx?" + Constants.NEWS_ID + "=" + nID;// "~/" + ConvertData.ReplaceURL(sTitle);
                //string sDate = ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "PostedDate")).Substring(0, 10);

                lnkTitleRelated.Text = sTitle;

                if (ncat == 2)
                {
                    lnkTitleRelated.NavigateUrl = sUrl + "&ncat=2";
                    lblDate.Visible = false;
                }
                else {
                    lnkTitleRelated.NavigateUrl = sUrl ;
                }
                //lblDate.Text =  " (" +sDate + ") ";
            }
        }
Esempio n. 16
0
 protected void LlenarGadget(object sender, RepeaterItemEventArgs e)
 {
     GadGet gad = (GadGet)e.Item.FindControl("GadGet1");
     gad.Tabla.Width = 150;
     Repeater rep = (Repeater)sender;
     DataRowView dr = (DataRowView)e.Item.DataItem;
 }
        protected void rptrKetquabinhchon_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            // Tính iPhantrambinhchon
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
                PollAnswerEntity oPhuongan = e.Item.DataItem as PollAnswerEntity;
                if (oPhuongan != null) {
                    double fPhantrambinhchon=0;
                    if (iTongsoluotbinhchon > 0)
                    {
                        fPhantrambinhchon = Convert.ToDouble(oPhuongan.iCount);
                        fPhantrambinhchon = (fPhantrambinhchon / iTongsoluotbinhchon) * 100;
                    }
                    // bind lblPhantrambinhchon
                    Label lblPhantrambinhchon = (Label)e.Item.FindControl("lblPhantrambinhchon");
                    lblPhantrambinhchon.Text = fPhantrambinhchon.ToString("0.###") + "%";

                    // bind pnlThanhphanbieudo
                    Panel pnlThanhphanBieudo = (Panel)e.Item.FindControl("pnlThanhphanBieudo");
                    pnlThanhphanBieudo.BackColor = System.Drawing.Color.Red;
                    pnlThanhphanBieudo.Height = Unit.Pixel(5);
                    pnlThanhphanBieudo.BorderColor = System.Drawing.Color.Black;
                    pnlThanhphanBieudo.BorderWidth = Unit.Pixel(1);
                    pnlThanhphanBieudo.Width = Unit.Percentage(fPhantrambinhchon);
                }
            }
        }
Esempio n. 18
0
        protected void foldersRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var dividerDiv = e.Item.FindControl("folderDividerDiv");
                if (dividerDiv == null)
                {
                    return;
                }

                if (!(e.Item.ItemIndex < NumberOfFolders - 1))
                {
                    dividerDiv.Visible = false;
                }

                var img = e.Item.FindControl("folderIcon");
                if (img == null)
                {
                    return;
                }

                var imageButton = (System.Web.UI.HtmlControls.HtmlAnchor)img;

                imageButton.Attributes["onclick"] = "folderClick('" + DataBinder.Eval(e.Item.DataItem, "Text") + "')";
            }
        }
        protected void Module_Sub_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            sys_ModuleTable s_Mt = (sys_ModuleTable)e.Item.DataItem;
            sys_RolePermissionTable s_Rp = BusinessFacade.sys_RolePermissionDisp(RoleID, ApplicationID, s_Mt.M_PageCode);

            string rightString = string.Format("<img src='{0}'>",ResolveClientUrl("~/Manager/images/right.gif"));
            string wrongString = string.Format("<img src='{0}'>",ResolveClientUrl("~/Manager/images/wrong.gif"));
            string dispString = "";
            string SelectTxt = "";
            int TempStep = 1;
            for (int i = 0; i < 8; i++)
            {
                TempStep = TempStep + TempStep;
                Literal li = (Literal)e.Item.FindControl(string.Format("Lab{0}_Txt",TempStep));
                if (li != null)
                {
                    if ((s_Rp.P_Value & TempStep) == TempStep)
                    {
                        dispString = rightString;
                        SelectTxt = "checked";
                    }
                    else
                    {
                        dispString = wrongString;
                        SelectTxt = "";
                    }
                    if (CMD == "Edit")
                    {
                        dispString = string.Format("<input type=checkbox id='PageCode{0}' name='PageCode{0}' value={1}  {2}>", s_Mt.M_PageCode, TempStep, SelectTxt);
                    }
                    li.Text = dispString;
                }
            }
        }
        private void _itemsRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {

            var product = e.Item.DataItem as Product;
            var webItem = WebItemManager.Instance[product.Id];

            var data = new List<object>();
            var items = webItem.Context.SpaceUsageStatManager.GetStatData();

            foreach (var it in items)
            {
                data.Add(new { Name = it.Name, Icon = it.ImgUrl, Size = FileSizeComment.FilesSizeToString(it.SpaceUsage), Url = it.Url });
            }

            if (items.Count == 0)
            {
                e.Item.FindControl("_emptyUsageSpace").Visible = true;
                e.Item.FindControl("_showMorePanel").Visible = false;

            }
            else
            {
                var repeater = (Repeater)e.Item.FindControl("_usageSpaceRepeater");
                repeater.DataSource = data;
                repeater.DataBind();


                e.Item.FindControl("_showMorePanel").Visible = (items.Count > 10);
                e.Item.FindControl("_emptyUsageSpace").Visible = false;
            }
        }
Esempio n. 21
0
        protected void rptStandardsPages_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                HyperLink lnkTitle = (HyperLink)e.Item.FindControl("lnkTitle");
                Label lblDescription = (Label)e.Item.FindControl("lblDescription");
                PlaceHolder plcDescription = (PlaceHolder)e.Item.FindControl("plcDescription");
                HyperLink lnkViewMore = (HyperLink)e.Item.FindControl("lnkViewMore");

                BEContent.tbl_ContentRow row = (BEContent.tbl_ContentRow)((DataRowView)e.Item.DataItem).Row;

                string pageLinkPath = "Content.aspx?ContentID=" + row.ContentID;
                lnkTitle.Text = row.IsContentTitleFRNull() ? "" : row.ContentTitleFR;
                lnkTitle.NavigateUrl = pageLinkPath;
                lnkViewMore.NavigateUrl = pageLinkPath;

                if (!row.IsContentBody1FRNull())
                {
                    string description = RemoveTags(row.ContentBody1FR);
                    if (description.Length > 350)
                        lblDescription.Text = description.Substring(0, 350) + "...";
                    else
                        lblDescription.Text = description;

                    plcDescription.Visible = true;
                }
            }
        }
Esempio n. 22
0
        protected void CategoryCreated(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var linkcat = (LinkCategory)e.Item.DataItem;
                if (linkcat != null)
                {
                    if (linkcat.Id != 0)
                    {
                        var description = (Label)e.Item.FindControl("Description");
                        if (description != null)
                        {
                            description.Text = linkcat.Description;
                        }

                        var catlink = (HyperLink)e.Item.FindControl("CatLink");
                        if (catlink != null)
                        {
                            catlink.NavigateUrl = Url.CategoryUrl(linkcat);
                            catlink.Text = linkcat.Title;
                            ControlHelper.SetTitleIfNone(catlink, linkcat.CategoryType + " Category.");
                        }
                    }
                }
            }
        }
Esempio n. 23
0
        protected void rptDisciplineLevels_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                HyperLink lnkTitle = (HyperLink)e.Item.FindControl("lnkTitle");
                Label lblDescription = (Label)e.Item.FindControl("lblDescription");
                PlaceHolder plcDescription = (PlaceHolder)e.Item.FindControl("plcDescription");
                HyperLink lnkViewMore = (HyperLink)e.Item.FindControl("lnkViewMore");
                string pageLinkPath = "DisciplineLevel.aspx?DisciplineLevelID=";

                BECompetencies.tbl_DisciplineLevelsRow row = (BECompetencies.tbl_DisciplineLevelsRow)((DataRowView)e.Item.DataItem).Row;

                lnkTitle.Text = row.IsDisciplineLevelTitleFRNull() ? "" : row.DisciplineLevelTitleFR;
                lnkTitle.NavigateUrl = pageLinkPath + row.DisciplineLevelID;
                lnkViewMore.NavigateUrl = pageLinkPath + row.DisciplineLevelID;

                if (!row.IsDisciplineLevelDescriptionFRNull())
                {
                    string description = RemoveTags(row.DisciplineLevelDescriptionFR);
                    if (description.Length > 350)
                        lblDescription.Text = description.Substring(0, 350) + "...";
                    else
                        lblDescription.Text = description;

                    plcDescription.Visible = true;
                }
            }
        }
Esempio n. 24
0
        protected void rItems_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                HyperLink hl1 = e.Item.FindControl("hl1") as HyperLink;
                HyperLink hl2 = e.Item.FindControl("hl2") as HyperLink;

                SideBarItem item = (SideBarItem)e.Item.DataItem;

                string title = item.Titles[Globals.CurrentLanguage];
                string url = item.NavigateUrl;//.Insert(2,Globals.CurrentLanguage+"/");
                url = url.Replace("{lang}", Globals.CurrentLanguage);

                if (hl1 != null)
                {
                    hl1.Text = title;
                    hl1.NavigateUrl = url;
                }

                if (hl2 != null)
                {
                    hl2.NavigateUrl = url;
                }

                Image icon_news = e.Item.FindControl("icon_news") as Image;
                if (icon_news != null)
                {
                    icon_news.Attributes.Add("style", item.ImageStyle);
                }
            }
        }
        protected void rptrRequests_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var returnRequest = (ReturnRequest)e.Item.DataItem;

                var lRequestTitle = (Literal)e.Item.FindControl("lRequestTitle");
                var lItem = (Literal)e.Item.FindControl("lItem");
                var lReason = (Literal)e.Item.FindControl("lReason");
                var lAction = (Literal)e.Item.FindControl("lAction");
                var lDate = (Literal)e.Item.FindControl("lDate");
                var phComments = (PlaceHolder)e.Item.FindControl("phComments");
                var lComments = (Literal)e.Item.FindControl("lComments");

                lRequestTitle.Text = string.Format(GetLocaleResourceString("CustomerReturnRequests.RequestTitle"), returnRequest.ReturnRequestId, OrderManager.GetReturnRequestStatusName(returnRequest.ReturnStatus));
                string prodLink = string.Format("<a href=\"{0}\">{1}</a>", SEOHelper.GetProductUrl(returnRequest.OrderProductVariant.ProductVariant.Product), returnRequest.OrderProductVariant.ProductVariant.LocalizedFullProductName);
                lItem.Text = string.Format(GetLocaleResourceString("CustomerReturnRequests.Item"), returnRequest.Quantity, prodLink);
                lReason.Text = string.Format(GetLocaleResourceString("CustomerReturnRequests.Reason"), Server.HtmlEncode(returnRequest.ReasonForReturn));
                lAction.Text = string.Format(GetLocaleResourceString("CustomerReturnRequests.Action"), Server.HtmlEncode(returnRequest.RequestedAction));
                lDate.Text = string.Format(GetLocaleResourceString("CustomerReturnRequests.Date"), DateTimeHelper.ConvertToUserTime(returnRequest.CreatedOn, DateTimeKind.Utc));
                if (!string.IsNullOrEmpty(returnRequest.CustomerComments))
                {
                    phComments.Visible = true;
                    lComments.Text = OrderManager.FormatReturnRequestCommentsText(returnRequest.CustomerComments);
                }
                else
                {
                    phComments.Visible = false;
                }
            }
        }
        protected void RepeaterEstoque_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            Veiculo veiculo = (Veiculo)e.Item.DataItem;

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                HyperLink linkEstoque = (HyperLink)e.Item.FindControl("linkEstoque");
                linkEstoque.NavigateUrl = "Detalhes.aspx?veic=" + veiculo.Id;

                Image imageVeiculo = (Image)e.Item.FindControl("imageVeiculo");
                imageVeiculo.ImageUrl = veiculo.Fotos[0];
                imageVeiculo.AlternateText = veiculo.Modelo;

                Label lblVeiculo = (Label)e.Item.FindControl("lblVeiculo");
                lblVeiculo.Text = veiculo.Marca + " " + veiculo.Modelo;

                Label lblPreco = (Label)e.Item.FindControl("lblPreco");
                lblPreco.Text = veiculo.Valor.ToString("c");

                Label lblDescricao = (Label)e.Item.FindControl("lblDescricao");
                lblDescricao.Text = veiculo.Versao + " " + veiculo.AnoFabricacao + "/" + veiculo.AnoModelo;

                Button BtnDetalhar = (Button)e.Item.FindControl("BtnDetalhar");
                BtnDetalhar.CommandArgument = veiculo.Id.ToString();
            }
        }
Esempio n. 27
0
        public void repPosts_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {

            }
        }
Esempio n. 28
0
 protected void LinkCreated(object sender, RepeaterItemEventArgs e)
 {
     if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         var link = (Link)e.Item.DataItem;
         if(link != null)
         {
             var linkControl = (HyperLink)e.Item.FindControl("Link");
             linkControl.NavigateUrl = link.Url;
             linkControl.Text = link.Title;
             ControlHelper.SetTitleIfNone(linkControl, link.Title);
             if(link.NewWindow)
             {
                 if(!String.IsNullOrEmpty(linkControl.Attributes["rel"]))
                 {
                     linkControl.Attributes["rel"] += " ";
                 }
                 linkControl.Attributes["rel"] += "external ";
             }
             linkControl.Attributes["rel"] += link.Relation;
             if(link.HasRss)
             {
                 var rssLink = (HyperLink)e.Item.FindControl("RssLink");
                 if(rssLink != null)
                 {
                     rssLink.NavigateUrl = link.Rss;
                     rssLink.Visible = true;
                     rssLink.ToolTip = string.Format(CultureInfo.InvariantCulture, Resources.LinkPage_Subscribe,
                                                     link.Title);
                     ControlHelper.SetTitleIfNone(rssLink, rssLink.ToolTip);
                 }
             }
         }
     }
 }
Esempio n. 29
0
 public void OnMenuItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     var showInNav = PermissionHelper.ShouldViewThePageInNav((SiteMapNode) e.Item.DataItem);
     if (showInNav) return;
     var liItem = e.Item.FindControl("liItem");
     liItem.Visible = false;
 }
Esempio n. 30
0
        protected void Content_DataBound(object sender, RepeaterItemEventArgs e)
        {
            try
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    Label lbl_ArticleTitle = (Label)e.Item.FindControl("lbl_ArticleTitle");
                    Literal literal_Body = (Literal)e.Item.FindControl("literal_Body");

                    string title = DataBinder.Eval(e.Item.DataItem, "Title").ToString();
                    string body = DataBinder.Eval(e.Item.DataItem, "Body").ToString();

                    lbl_ArticleTitle.Text = title;
                    literal_Body.Text = body.Replace(Environment.NewLine, "<br />");

                    if (User.IsInRole("superadmin") || User.IsInRole("admin"))
                    {
                        Panel Panel1 = (Panel)e.Item.FindControl("Panel1");
                        Panel1.Visible = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 31
0
 protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         i++;
     }
 }
Esempio n. 32
0
        protected void rptOfficeVisits_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            { return; }

            Repeater rpt = (Repeater)sender;

            //Could be either a Service or a drug
            dynamic d = e.Item.DataItem;
            //Is this a drug item or not
            Boolean drugItem = d.Category.ToLower().Contains("drug");

            LinkButton lbtnYouCouldHaveSaved = (LinkButton)e.Item.FindControl("lbtnYouCouldHaveSaved");
            Label lblYouCouldHaveSavedNothing = (Label)e.Item.FindControl("lblYouCouldHaveSavedNothing");

            if (d.YouCouldHaveSaved == "$0")
            { lblYouCouldHaveSavedNothing.Visible = true; lbtnYouCouldHaveSaved.Visible = false; }
            else
            {
                lblYouCouldHaveSavedNothing.Visible = false; lbtnYouCouldHaveSaved.Visible = true;
                lbtnYouCouldHaveSaved.CommandArgument = String.Format("{0}|{1}|{2}|", d.ServiceName, d.FacilityName, rpt.ID);
                if (drugItem)
                    lbtnYouCouldHaveSaved.CommandArgument = String.Concat(
                        lbtnYouCouldHaveSaved.CommandArgument,
                        String.Format("{0}~{1}~{2}~{3}", d.GPI, d.Quantity, d.DrugID, d.PharmacyLocationID));
                else
                    lbtnYouCouldHaveSaved.CommandArgument = String.Concat(
                        lbtnYouCouldHaveSaved.CommandArgument,
                        d.ProcedureCode);
                lbtnYouCouldHaveSaved.CommandArgument = String.Concat(
                    lbtnYouCouldHaveSaved.CommandArgument,
                    String.Format("|{0}|{1}|{2}", d.SpecialtyID, d.PastCareID, d.ServiceID));
                lbtnYouCouldHaveSaved.CommandName = "Select";
            }
        }
Esempio n. 33
0
 protected void LinkCreated(object sender,  RepeaterItemEventArgs e)
 {
     if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Link link = (Link)e.Item.DataItem;
         if(link != null)
         {
             HyperLink Link = (HyperLink)e.Item.FindControl("Link");
             Link.NavigateUrl = link.Url;
             Link.Text = link.Title;
             ControlHelper.SetTitleIfNone(Link, link.Title);
             if(link.NewWindow)
             {
                 if(!String.IsNullOrEmpty(Link.Attributes["rel"]))
                 {
                     Link.Attributes["rel"] += " ";
                 }
                 Link.Attributes["rel"] += "external ";
             }
             Link.Attributes["rel"] += link.Relation;
             if(link.HasRss)
             {
                 HyperLink RssLink = (HyperLink)e.Item.FindControl("RssLink");
                 if(RssLink != null)
                 {
                     RssLink.NavigateUrl = link.Rss;
                     RssLink.Visible = true;
                     RssLink.ToolTip = string.Format("Subscribe to {0}", link.Title);
                     ControlHelper.SetTitleIfNone(RssLink, RssLink.ToolTip);
                 }
             }
         }
     }
 }
        private void rptLinks_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                NavigationLinkItem item = (NavigationLinkItem)e.Item.DataItem;

                FieldRenderer frLink = e.FindControlAs<FieldRenderer>("frLink");
                frLink.Item = item;

                if (item.Link.Field != null)
                {
                    // Handle initial menu choice
                    if (e.Item.ItemIndex == 0)
                    {
                        litInitialMenuChoice.Text = item.Link.Field.Text;
                    }

                    // Selected state
                    Item navItem = Sitecore.Context.Item;
                    while (navItem != null)
                    {
                        if (item.Link.Field.TargetID == navItem.ID) 
                        {
                            frLink.Parameters = "class=selected";
                            break;
                        }
                        navItem = navItem.Parent;
                    }
                }
            }
        }
Esempio n. 35
0
        //美化列表
        protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                //美化导航树结构
                Literal LitFirst = (Literal)e.Item.FindControl("LitFirst");
                HiddenField hidLayer = (HiddenField)e.Item.FindControl("hidLayer");
                string LitStyle = "<span style=\"display:inline-block;width:{0}px;\"></span>{1}{2}";
                string LitImg1 = "<span class=\"folder-open\"></span>";
                string LitImg2 = "<span class=\"folder-line\"></span>";

                int classLayer = Convert.ToInt32(hidLayer.Value);
                if (classLayer == 1)
                {
                    LitFirst.Text = LitImg1;
                }
                else
                {
                    LitFirst.Text = string.Format(LitStyle, (classLayer - 2) * 24, LitImg2, LitImg1);
                }
                //绑定导航权限资源
                string[] actionTypeArr = ((HiddenField)e.Item.FindControl("hidActionType")).Value.Split(',');
                CheckBoxList cblActionType = (CheckBoxList)e.Item.FindControl("cblActionType");
                cblActionType.Items.Clear();
                for (int i = 0; i < actionTypeArr.Length; i++)
                {
                    if (Utils.ActionType().ContainsKey(actionTypeArr[i]))
                    {
                        cblActionType.Items.Add(new ListItem(" " + Utils.ActionType()[actionTypeArr[i]] + " ", actionTypeArr[i]));
                    }
                }
            }
        }
Esempio n. 36
0
 protected void rptPricebf_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         ImageButton imgBtn = e.Item.FindControl("imgBtn") as ImageButton;
         TextBox txtCom = e.Item.FindControl("txtCom") as TextBox;
         if (imgBtn == null || txtCom == null)
         {
             return;
         }
         if (((System.Data.DataRowView)(e.Item.DataItem)).Row.ItemArray[7] != null)
         {
             if (((System.Data.DataRowView)(e.Item.DataItem)).Row.ItemArray[7].ToString() != "")
             {
                 imgBtn.Visible = false;
                 txtCom.Visible = false;
             }
         }
         else
         {
             imgBtn.Visible = true;
             txtCom.Visible = true;
         }
     }
 }
Esempio n. 37
0
 //绑定产品
 protected void rptProduct_OnItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         //var product = e.Item.DataItem as Ye_Product;
         //var lbl = e.Item.FindControl("lblAmount") as Label;
         //var hf = e.Item.FindControl("hfAmount") as HiddenField;
         //if (Request.Cookies["shop_" + product.ShopID] != null)
         //{
         //    var temp = Request.Cookies["shop_" + product.ShopID].Values[product.ProductID.ToString()];
         //    if (temp != null)
         //    {
         //        hf.Value = lbl.Text = temp;
         //    }
         //    else
         //    {
         //        hf.Value = lbl.Text = "0";
         //    }
         //}
         //else
         //{
         //    hf.Value = lbl.Text = "0";
         //}
         //lbl.Attributes["data-pid"] = product.ProductID.ToString();
     }
 }
Esempio n. 38
0
        private void RepeaterControl_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
              {
            KefWebData data = (KefWebData) e.Item.DataItem;
            HyperLink lnkKefLink = (HyperLink) e.Item.FindControl("lnkKefLink");

            lnkKefLink.Text = data.Title;

            if (!data.Link.IsNull && data.Link.Length > 0)
            {
              lnkKefLink.NavigateUrl = data.Link;

              if (lnkKefLink != null)
              {
            lnkKefLink.Visible = true;
            if (!data.Link.StartsWith(@"http://") && !data.Link.StartsWith(@"https://"))
            {
              lnkKefLink.NavigateUrl = "http://" + data.Link;
            }
              }
            }
            else
            {
              lnkKefLink.Visible = false;
            }
              }
        }
Esempio n. 39
0
        protected void repeater_tabs_databound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                HyperLink hplTabs = (HyperLink)e.Item.FindControl("hplTabs");
                ServiceArticle dataitem = (ServiceArticle)e.Item.DataItem;

                hplTabs.Text = dataitem.Title;
                hplTabs.ToolTip = hplTabs.Text;
                hplTabs.NavigateUrl = "~/s/services.aspx?aid=" + dataitem.Id;

                if (serviceId != 0 && serviceId == dataitem.Id)
                {
                    hplTabs.Attributes.Add("class", "selected");
                }

                List<ServiceArticle> sublist = ServiceArticle.GetSubArticlesById(Convert.ToInt32(dataitem.Id));
                if (sublist.Count > 0)
                {
                    Repeater repeater_subtabs = (Repeater)e.Item.FindControl("repeater_subtabs");
                    repeater_subtabs.DataSource = sublist;
                    repeater_subtabs.DataBind();
                }
            }
        }
Esempio n. 40
0
        private void dgList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                DataTable tbDtl = (DataTable)Session["CostPlanBatchModify_tbDtl"];

                string ContractCode = ((HtmlInputHidden)e.Item.FindControl("txtContractCode")).Value;
                string DtlCode      = ((HtmlInputHidden)e.Item.FindControl("txtDtlCode")).Value;

                string      CostCode = ((HtmlInputHidden)e.Item.FindControl("txtCostCode")).Value;
                PlaceHolder phPlan   = (PlaceHolder)e.Item.FindControl("phPlan");

                int MonthCount = BLL.ConvertRule.ToInt(this.txtMonthCount.Value);

                //明细记录
                DataRow[] drsDtl = tbDtl.Select("DtlCode = '" + DtlCode + "'");
                DataRow   drDtl  = null;
                if (drsDtl.Length > 0)
                {
                    drDtl = drsDtl[0];
                }

                for (int i = 0; i < MonthCount; i++)
                {
                    string ym = BLL.StringRule.YmAddMonths(this.txtStartYm.Value, i);

                    HtmlInputText      txt  = (HtmlInputText)e.Item.FindControl("txtPlanMoney_" + ym);
                    HtmlGenericControl span = (HtmlGenericControl)e.Item.FindControl("spanPlanMoney_" + ym);

                    if (ContractCode == "") //费用项
                    {
                        txt.Style["display"] = "none";
                    }
                    else //合同
                    {
                        span.Style["display"] = "none";
                    }

                    if (drDtl != null)
                    {
                        //计划金额
                        string sMoney = GetMoneyShowString(drDtl["PlanMoneyYm_" + ym]);

                        //费用项上不显示计划金额
                        if (ContractCode == "")
                        {
                            sMoney = "";
                        }

                        txt.Value = sMoney;
                        txt.Attributes["RowIndex"]   = e.Item.ItemIndex.ToString();
                        txt.Attributes["ParentCode"] = BLL.ConvertRule.ToString(drDtl["ParentCode"]);

                        span.InnerText = sMoney;
                        span.Attributes["RowIndex"] = e.Item.ItemIndex.ToString();
                    }
                }
            }
        }
Esempio n. 41
0
        // SubjConsentItemID, SubjConsentID, cioID, ItemDateSigned, ItemTimeSigned, SubjConsentItemNotes, ConsentFormVersion_ConsentItemID, ConsentItemText
        // ConsentFormVersion_ConsentItemID, cioID, OptionText



        protected void rpConsentItems_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            //if item type is an item setup the drop down list
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label l = (Label)e.Item.FindControl("lblConsentItem");
                l.Text = ((DataRowView)e.Item.DataItem)["ConsentItemText"].ToString();

                //setup drop down list
                DropDownList ddl     = (DropDownList)e.Item.FindControl("ddlConsentItem");
                DataTable    options = _consentData.Tables[1];


                string sConsentItemID = ((DataRowView)e.Item.DataItem)["ConsentFormVersion_ConsentItemID"].ToString();
                options.DefaultView.RowFilter = "ConsentFormVersion_ConsentItemID = " + sConsentItemID;


                ddl.DataSource     = options.DefaultView;
                ddl.DataTextField  = "OptionText";
                ddl.DataValueField = "cioID";
                ddl.DataBind();

                string selectedValue = ((DataRowView)e.Item.DataItem)["cioID"].ToString();

                if (selectedValue == "-1")
                {
                    selectedValue = "0";
                }

                if (int.Parse(((DataRowView)e.Item.DataItem)["cioID"].ToString()) > 0)
                {
                    ddl.Items.FindByValue(selectedValue).Selected = true;
                    //ddl.SelectedValue = ((DataRowView)e.Item.DataItem)["cioID"].ToString();
                }

                Label txtcioID = (Label)e.Item.FindControl("txtcioID");
                txtcioID.Text = selectedValue;


                //date, time, and note fields
                DateTime itemdate = new DateTime();
                TextBox  d        = (TextBox)e.Item.FindControl("txtItemDateSigned");
                if (DateTime.TryParse(((DataRowView)e.Item.DataItem)["ItemDateSigned"].ToString(), out itemdate))
                {
                    d.Text = itemdate.ToString("MM/dd/yyyy");
                }
                else
                {
                    d.Text = "";
                }
                TextBox t = (TextBox)e.Item.FindControl("txtItemTimeSigned");
                t.Text = ((DataRowView)e.Item.DataItem)["ItemTimeSigned"].ToString();
                TextBox n = (TextBox)e.Item.FindControl("txtSubjConsentItemNotes");
                n.Text = ((DataRowView)e.Item.DataItem)["SubjConsentItemNotes"].ToString();
                //save value of SubjConsentItemID. I'll use it later for updating
                HtmlInputHidden ht = (HtmlInputHidden)e.Item.FindControl("txtSubjConsentItemID");
                ht.Value = ((DataRowView)e.Item.DataItem)["SubjConsentItemID"].ToString();
            }
        }
Esempio n. 42
0
 protected void rptList_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.Web.UI.WebControls.HiddenField hiddenField = e.Item.FindControl("hdfMessageType") as System.Web.UI.WebControls.HiddenField;
         hiddenField.Value = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "MessageType").ToString();
     }
 }
Esempio n. 43
0
 private void Repeater1_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem)
     {
         e.Item.Controls.Add(new CheckBox());
         e.Item.Controls.Add(new LiteralControl("<br>"));
     }
 }
 private void Repeater1_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         ImageButton bt = e.Item.FindControl("delete1") as ImageButton;
         bt.Attributes.Add("onclick", "return deletedoc();");
     }
 }
Esempio n. 45
0
 protected void rptrFeeds_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item)
     {
         Button delButton = (Button)e.Item.FindControl("btnDeleteFeed");
         delButton.Attributes.Add("onClick", "javascript: return confirm('" + AppLogic.GetString("admin.feeds.msgconfirmdeletion", SkinID, LocaleSetting) + "')");
     }
 }
Esempio n. 46
0
        private void category_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            RepeaterItem item = e.Item;

            if ((item.ItemType == ListItemType.Item) || (item.ItemType == ListItemType.AlternatingItem))
            {
            }
        }
Esempio n. 47
0
 private void repeater1_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView _DR = e.Item.DataItem as DataRowView;
         appoSaldo = appoSaldo - Double.Parse(_DR["Speso"].ToString());
         ((Label)e.Item.FindControl("lblSaldo")).Text = Formatta(appoSaldo.ToString());
     }
 }
Esempio n. 48
0
        protected void rptStoryQuote_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                try
                {
                    Item nodeItm = (Item)e.Item.DataItem;
                    //Text fldQuote = (Text)e.Item.FindControl("fldQuote");
                    Text fldCitation = (Text)e.Item.FindControl("fldCitation");

                    //Literal litFeatured = (Literal)e.Item.FindControl("litFeatured");
                    //Literal litComingNext = (Literal)e.Item.FindControl("litComingNext");

                    Literal litQuote    = (Literal)e.Item.FindControl("litQuote");
                    Literal litCitation = (Literal)e.Item.FindControl("litCitation");

                    string quoteText    = string.Empty;
                    string citationText = string.Empty;

                    if (nodeItm.Fields["Quote"] != null)
                    {
                        Sitecore.Data.Fields.CheckboxField fldIsQuote = nodeItm.Fields["Not Quote"];
                        if (fldIsQuote.Checked == true)
                        {
                            //quote text is p text
                            quoteText     = string.Format("<{0}>{1}</{0}>", "p", nodeItm.Fields["Quote"]);
                            litQuote.Text = quoteText;
                        }
                        else
                        {
                            quoteText     = string.Format("<{0}><{1}>{2}</{1}></{0}>", "blockquote", "q", nodeItm.Fields["Quote"]);
                            litQuote.Text = quoteText;
                        }
                    }

                    if (nodeItm.Fields["Citation"].Value == "")
                    {
                        citationText     = string.Format("<{0}>{1}</{0}>", "div", nodeItm.Fields["Citation"]);
                        litCitation.Text = citationText;
                    }
                    else
                    {
                        citationText     = string.Format("<{0}>{1}</{0}>", "cite", nodeItm.Fields["Citation"]);
                        litCitation.Text = citationText;
                    }



                    //fldQuote.Item = nodeItm;
                    //fldCitation.Item = nodeItm;
                }
                catch (Exception ex)
                {
                    bool exHandled = handleException(ex);
                }
            }
        }
Esempio n. 49
0
 private void rpSku_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("skuContent");
     if (literal != null)
     {
         object obj = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "skuid");
         literal.Text = this.GetSkuContent((string)obj);
     }
 }
Esempio n. 50
0
 protected void Repeater1_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Repeater rptr = (Repeater)e.Item.FindControl("Repeater2");
         rptr.DataSource = csvData.AsEnumerable().Where(x => x["category"].Equals(e.Item.DataItem));
         rptr.DataBind();
     }
 }
Esempio n. 51
0
    protected void rptCourses_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
    {
        MyBuyList.Shared.Entities.Menu menu = this.currentMenu;

        Meal          currentMeal      = null;
        MealDayOfWeek currentWeekDay   = null;
        int           currentWeekDayId = 0;

        int currentCourseOrMenuTypeId = ((CourseOrMealType)e.Item.DataItem).CourseOrMealTypeId;

        RepeaterItem parentItem = e.Item.Parent.Parent as RepeaterItem;

        if (parentItem != null)
        {
            currentWeekDay = parentItem.DataItem as MealDayOfWeek;
        }
        if (currentWeekDay != null)
        {
            currentWeekDayId = currentWeekDay.DayId;
        }

        if (menu.MenuTypeId == (int)MenuTypeEnum.OneMeal || menu.MenuTypeId == (int)MenuTypeEnum.QuickMenu)
        {
            foreach (Meal m in this.currentMenu.Meals.ToArray())
            {
                if (m.CourseTypeId == currentCourseOrMenuTypeId)
                {
                    currentMeal = m;
                }
            }
        }
        if (menu.MenuTypeId == (int)MenuTypeEnum.Weekly)
        {
            foreach (Meal m in this.currentMenu.Meals.ToArray())
            {
                if (m.MealTypeId == currentCourseOrMenuTypeId && m.DayIndex == currentWeekDayId)
                {
                    currentMeal = m;
                }
            }
        }

        if (currentMeal == null)
        {
            return;
        }

        this.CurrentMeal = currentMeal;

        Repeater rpt = e.Item.FindControl("rptRecipes") as Repeater;

        if (rpt != null)
        {
            rpt.DataSource = currentMeal.MealRecipes.ToArray();
            rpt.DataBind();
        }
    }
Esempio n. 52
0
 protected void popup_Notifications_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Label notification = (Label)e.Item.FindControl("lbl_Notification_Popup");
         notification.Text = list_Notification.ElementAt(i).Notificate;
         i++;
     }
 }
Esempio n. 53
0
        protected void rptrJobByCategory_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            var repeater = sender as Repeater;

            if (repeater != null && repeater.Items.Count > 3)
            {
                ((Repeater)sender).Controls.RemoveAt(3);
            }
        }
Esempio n. 54
0
        void RptrTestsItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            var request        = (AuthenticateRequest)e.Item.DataItem;
            var lMessage       = (Label)e.Item.FindControl("lMessage");
            var lSuccess       = (Label)e.Item.FindControl("lSuccess");
            var lUser          = (Label)e.Item.FindControl("lUser");
            var lUsername      = (Label)e.Item.FindControl("lUsername");
            var lFirstName     = (Label)e.Item.FindControl("lFirstName");
            var lLastName      = (Label)e.Item.FindControl("lLastName");
            var lAddress       = (Label)e.Item.FindControl("lAddress");
            var lAddressStreet = (Label)e.Item.FindControl("lAddressStreet");
            var lCity          = (Label)e.Item.FindControl("lCity");
            var lState         = (Label)e.Item.FindControl("lState");
            var lZip           = (Label)e.Item.FindControl("lZip");
            var phAddress      = (PlaceHolder)e.Item.FindControl("phAddress");
            var hUsername      = (Label)e.Item.FindControl("hUsername");

            hUsername.Text = request.Username;

            //var restClient = new JsonServiceClient("http://localhost:25000/");
            var restClient = new XmlServiceClient("http://localhost:25000/");

            restClient.Timeout = new TimeSpan(0, 0, 30);
            var response = restClient.Send <AuthenticateResponse>(request);

            lMessage.Text = response.Message ?? "null";
            lSuccess.Text = response.Success ? "true" : "false";

            if (response.User == null)
            {
                lUser.Text = "null";
            }
            else
            {
                lUser.Text = "not null";
                User u = response.User;
                lUsername.Text  = u.Username ?? "null";
                lFirstName.Text = u.FirstName ?? "null";
                lLastName.Text  = u.LastName ?? "null";
                if (u.Address == null)
                {
                    lAddress.Text     = "null";
                    phAddress.Visible = false;
                }
                else
                {
                    lAddress.Text = "not null";

                    Address a = u.Address;
                    lAddressStreet.Text = a.Street ?? "null";
                    lCity.Text          = a.City ?? "null";
                    lState.Text         = a.State ?? "null";
                    lZip.Text           = a.Zip ?? "null";
                }
            }
        }
Esempio n. 55
0
    protected void listRepeater_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
    {
        HtmlInputCheckBox chkbox   = (HtmlInputCheckBox)e.Item.FindControl("chkbox");
        HtmlInputHidden   hdnSeqID = (HtmlInputHidden)e.Item.FindControl("hdnSeqID");

        Label seqID = (Label)e.Item.FindControl("seqID");

        System.Web.UI.WebControls.Image imgType = (System.Web.UI.WebControls.Image)e.Item.FindControl("imgType");
        Label userNm  = (Label)e.Item.FindControl("userNm");
        Label comment = (Label)e.Item.FindControl("comment");
        Label rgDt    = (Label)e.Item.FindControl("rgDt");


        string rank = DataBinder.Eval(e.Item.DataItem, "rank").ToString();

        seqID.Text  = DataBinder.Eval(e.Item.DataItem, "SeqID").ToString();
        userNm.Text = DataBinder.Eval(e.Item.DataItem, "UserNm").ToString();
        userNm.Text = "<a href=\"javascript:fNewWin('" + DataBinder.Eval(e.Item.DataItem, "Uno").ToString() + "', '" + DataBinder.Eval(e.Item.DataItem, "UserID").ToString() + "');\">" + userNm.Text + "</a>";

        comment.Text = NoteUtil.BoldSearchWord(DataBinder.Eval(e.Item.DataItem, "Comment").ToString(), this.searchWord);
        comment.Style.Add("color", DataBinder.Eval(e.Item.DataItem, "FontColor").ToString());
        rgDt.Text = ((DateTime)DataBinder.Eval(e.Item.DataItem, "rgDt")).ToString("yyyy-MM-dd HH:mm:ss");

        string type = DataBinder.Eval(e.Item.DataItem, "MemoType").ToString();

        if (type == "1")
        {
            imgType.ImageUrl = "http://img.imbc.com/mini/UserNote/images/mini_memo_icon_web.gif";
        }
        else if (type == "2")
        {
            imgType.ImageUrl = "http://img.imbc.com/mini/UserNote/images/mini_memo_icon_memo.gif";
        }
        else if (type == "4")
        {
            imgType.ImageUrl = "http://img.imbc.com/mini/UserNote/images/mini_memo_icon_phone.gif";
        }
        else
        {
            imgType.ImageUrl = "http://img.imbc.com/mini/UserNote/images/mini_memo_icon_mini.gif";
        }

        int    uno    = (int)DataBinder.Eval(e.Item.DataItem, "Uno");
        string userID = DataBinder.Eval(e.Item.DataItem, "UserID").ToString();

        chkbox.Value   = uno.ToString() + "│" + userID + "│" + DataBinder.Eval(e.Item.DataItem, "UserNm").ToString();
        hdnSeqID.Value = DataBinder.Eval(e.Item.DataItem, "SeqID").ToString();

        if (rank != "0")
        {
            seqID.Text        = "■";
            userNm.Font.Bold  = true;
            comment.Font.Bold = true;
            comment.ForeColor = Color.DarkBlue;
        }
    }
Esempio n. 56
0
    protected void rpt1_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
    {
        DataRowView dv      = e.Item.DataItem as DataRowView;
        Image       ImgCard = ((ImageButton)e.Item.FindControl("ImgView"));

        if (dv != null)
        {
            Repeater nestedRepeater = e.Item.FindControl("rpt2") as Repeater;
            if (nestedRepeater != null)
            {
                nestedRepeater.DataSource = dv.CreateChildView("NestedCat");
                nestedRepeater.DataBind();
            }
        }
        if (e.Item.ItemType == ListItemType.Item ||
            e.Item.ItemType == ListItemType.AlternatingItem)
        {
            DropDownList myDDL   = (DropDownList)e.Item.FindControl("DDLPort");
            Button       btnSave = (Button)e.Item.FindControl("btnsave");
            DataTable    dt      = objPortCall.Get_PortCall_PortList(0, UDFLib.ConvertIntegerToNull(DataBinder.Eval(e.Item.DataItem, "Vessel_ID").ToString()), 1);
            if (dt.Rows.Count > 0)
            {
                myDDL.DataSource     = dt;
                myDDL.DataTextField  = "Port_Name";
                myDDL.DataValueField = "Port_ID";
                myDDL.DataBind();
                if (uaEditFlag)
                {
                    btnSave.Enabled = true;
                }
            }
            else
            {
                myDDL.DataSource     = dt;
                myDDL.DataTextField  = "Port_Name";
                myDDL.DataValueField = "Port_ID";
                myDDL.DataBind();
                myDDL.Enabled   = false;
                btnSave.Enabled = false;
            }
            Button GeneralButton = (Button)e.Item.FindControl("btnsave");
        }

        if (rpt1 != null && rpt1.Items.Count < 1)
        {
            if (e.Item.ItemType == ListItemType.Footer)
            {
                // Show the Error Label (if no data is present).
                Label lblErrorMsg = e.Item.FindControl("lblErrorMsg") as Label;
                if (lblErrorMsg != null)
                {
                    lblErrorMsg.Visible = true;
                }
            }
        }
    }
Esempio n. 57
0
 protected void rptMenu_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView drv = (DataRowView)e.Item.DataItem;
         //Bind data to URL
         HtmlAnchor aLink = (HtmlAnchor)e.Item.FindControl("aLink");
         Utilities.SetLinkMenu(CurrentWeb, WebUrl, drv, aLink);
     }
 }
Esempio n. 58
0
 private void repreplykey_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.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("repreply");
         int replyKeyId = (int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "id");
         repeater.DataSource = WeiboHelper.GetReplyInfo(replyKeyId);
         repeater.DataBind();
     }
 }
Esempio n. 59
0
        void rptMenu_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRow    drv   = (DataRow)e.Item.DataItem;
                HtmlAnchor aLink = (HtmlAnchor)e.Item.FindControl("aLink");

                Utilities.SetMenuLink(drv, aLink, dtMenuType, HttpContext.Current);
            }
        }
        private void rptTemplates_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            Template template = e.Item.DataItem as Template;

            if (template != null)
            {
                HyperLink hplEdit = (HyperLink)e.Item.FindControl("hplEdit");
                hplEdit.NavigateUrl = String.Format("~/Admin/TemplateEdit.aspx?TemplateId={0}", template.Id);
            }
        }