Ejemplo n.º 1
0
 protected void rptToChuc_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;
         Repeater    rptSubToChuc = (Repeater)e.Item.FindControl("rptSubToChuc");
         rptSubToChuc.ItemDataBound += new RepeaterItemEventHandler(rptSubToChuc_ItemDataBound);
         //Bind data to URL
         HtmlAnchor aLink = (HtmlAnchor)e.Item.FindControl("aLink");
         aLink.Title     = Convert.ToString(drv["Title"]);
         aLink.InnerText = Convert.ToString(drv["Title"]);
         aLink.HRef      = "javascript:void(0)";
         //Bind data to submenu
         if ("SoDoToChucUC".Equals(parentWebpart.Title))
         {
             Utilities.BindOrganizationToRpt(CurrentWeb, rptSubToChuc, ListsName.InternalName.CategoryList, FieldsName.CategoryList.InternalName.ParentID,
                                             "Text", Convert.ToString(drv[FieldsName.CategoryList.InternalName.CategoryID]), FieldsName.CategoryList.InternalName.Order);
         }
         else if ("SoDoToChucDefaultPageUC".Equals(parentWebpart.Title))
         {
             //Bind source to menu with type is Đơn vị
             MenuBO.BindMenu(CurrentWeb, ListsName.InternalName.MenuList, rptSubToChuc, "Đơn vị", Convert.ToString(drv["MenuID"]));
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Load default value to control and other initialize.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     rptMenu.ItemDataBound += new RepeaterItemEventHandler(rptMenu_ItemDataBound);
     aHome.HRef             = CurrentWeb.Url;
     if (!Page.IsPostBack)
     {
         MenuBO.BindMenu(CurrentWeb, ListsName.InternalName.MenuList, rptMenu, "Footer menu");
     }
 }
Ejemplo n.º 3
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;
         Repeater    rptSubMenu = (Repeater)e.Item.FindControl("rptSubMenu");
         rptSubMenu.ItemDataBound += new RepeaterItemEventHandler(rptSubMenu_ItemDataBound);
         Literal ltrStyle = (Literal)e.Item.FindControl("ltrStyle");
         //Bind data to URL
         HtmlAnchor aLink = (HtmlAnchor)e.Item.FindControl("aLink");
         Utilities.SetLinkMenu(CurrentWeb, HttpContext.Current, WebUrl, drv, aLink, ltrStyle, false);
         //Bind data to submenu
         MenuBO.BindMenu(CurrentWeb, ListsName.InternalName.MenuList, rptSubMenu, "Top menu", Convert.ToString(drv["MenuID"]));
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Load default value to control and other initialize.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            rptMenu.ItemDataBound += new RepeaterItemEventHandler(rptMenu_ItemDataBound);
            aHome.HRef             = CurrentWeb.Url;
            var currentUrl = HttpContext.Current.Request.Url.AbsolutePath;

            if (!currentUrl.Contains(".aspx") || currentUrl.Contains("default.aspx"))
            {
                aHome.Attributes.Add("class", "current");
            }
            if (!Page.IsPostBack)
            {
                MenuBO.BindMenu(CurrentWeb, ListsName.InternalName.MenuList, rptMenu, "Top menu");
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Load default value to control and other initialize.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     divDV.Visible   = false;
     divSDTC.Visible = false;
     parentWebpart   = this.Parent as ContainerWebPart;
     if ("SoDoToChucUC".Equals(parentWebpart.Title))
     {
         divSDTC.Visible          = true;
         rptToChuc.ItemDataBound += new RepeaterItemEventHandler(rptToChuc_ItemDataBound);
         currentCatId             = HttpContext.Current.Request.QueryString["CatId"];
         if (!Page.IsPostBack)
         {
             Utilities.BindOrganizationToRpt(CurrentWeb, rptToChuc, ListsName.InternalName.CategoryList, FieldsName.CategoryList.InternalName.CategoryLevel,
                                             "Text", "2", FieldsName.CategoryList.InternalName.Order);
         }
     }
     else if ("SoDoToChucDefaultPageUC".Equals(parentWebpart.Title))
     {
         divDV.Visible            = true;
         rptToChuc.ItemDataBound += new RepeaterItemEventHandler(rptToChuc_ItemDataBound);
         //Bind source to menu with type is Đơn vị
         MenuBO.BindMenu(CurrentWeb, ListsName.InternalName.MenuList, rptToChuc, "Đơn vị");
     }
 }