Example #1
0
        private void RendMenu(MenuItem objMenuItem, Menu Menu, int intCategory, int intLanguages)
        {
            DB.DB_Object.ClassTypeNews objClassData = new DB.DB_Object.ClassTypeNews();
            DataTable dt = objClassData.getDataTypeNewsByNkey(intCategory);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    MenuItem _menuItem = new MenuItem();

                    if (intLanguages == DB.Common.ClassPGFCommon.LanguagesContanst.ENGLISH)
                    {
                        _menuItem.Text = dr["NameNewsEL"].ToString();
                    }
                    else
                    {
                        _menuItem.Text = dr["NameNewsVN"].ToString();
                    }

                    if (!string.IsNullOrEmpty(dr["PageLink"].ToString()))
                    {
                        _menuItem.NavigateUrl = dr["PageLink"].ToString();
                    }
                    else
                    {
                        _menuItem.NavigateUrl = "~/news.aspx?typenewsid=" + dr["TypeNewsID"].ToString();
                    }
                    //_menuItem.SeparatorImageUrl = "~/Images/MiddlePrice.gif";
                    //_menuItem.PopOutImageUrl = "~/Images/MiddlePrice.gif";
                    objMenuItem.ChildItems.Add(_menuItem);
                }
            }
        }
Example #2
0
        private void LoadGrid()
        {
            int intNkey = 0;//Null=0

            DB.DB_Object.ClassTypeNews objClassData = new DB.DB_Object.ClassTypeNews();
            DataTable dt = objClassData.getDataTypeNewsByNkey(intNkey);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    //Create Grid
                    string strPosition = string.Empty;
                    if (int.Parse(dr["PositionDisPlay"].ToString()) == 0)
                    {
                        strPosition = "Menu trên";
                    }
                    else if (int.Parse(dr["PositionDisPlay"].ToString()) == 1)
                    {
                        strPosition = "Menu dưới";
                    }
                    else if (int.Parse(dr["PositionDisPlay"].ToString()) == 2)
                    {
                        strPosition = "Menu trên + Dưới";
                    }
                    else if (int.Parse(dr["PositionDisPlay"].ToString()) == 3)
                    {
                        strPosition = "Menu trên phải";
                    }
                    else
                    {
                        strPosition = "Chi tiết sản phẩm";
                    }

                    strHTML.AppendFormat("<tr style=\"height:20px;\"><td><a href='{0}'>{1}</a></td><td>{2}</td><td>{3}</td></tr>", ResolveUrl("~/Amincp/ManagerTopFicEditor.aspx?Flag=Edit&TypeNewsID=" + dr["TypeNewsID"].ToString()), dr["NameNewsVN"].ToString(), dr["OrderNo"].ToString(), strPosition);

                    //Tạo menu cap 2
                    CreateMenuItem(int.Parse(dr["TypeNewsID"].ToString()));
                }
                ltrHtmlTr.Text = strHTML.ToString();
            }
        }