protected void Page_Load(object sender, EventArgs e)
        {
            DirectionController dc = new DirectionController();

            rptDirections.DataSource = dc.GetDirections();
            rptDirections.DataBind();
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LanguageController lc = new LanguageController();
                ddlLanguageID.DataSource     = lc.GetLanguages();
                ddlLanguageID.DataTextField  = "LanguageTitle";
                ddlLanguageID.DataValueField = "LanguageID";
                ddlLanguageID.DataBind();
                ddlLanguageID.Items.Insert(0, new ListItem("Root Language", "0"));

                DirectionController dc = new DirectionController();
                ddlDirectionID.DataSource     = dc.GetDirections();
                ddlDirectionID.DataTextField  = "DirectionTitle";
                ddlDirectionID.DataValueField = "DirectionID";
                ddlDirectionID.DataBind();
                ddlDirectionID.Items.Insert(0, new ListItem("Root Direction", "0"));

                MenuController cc = new MenuController();
                ddlParentID.DataSource     = cc.GetParentMenus();
                ddlParentID.DataTextField  = "Title";
                ddlParentID.DataValueField = "MenuID";
                ddlParentID.DataBind();
                ddlParentID.Items.Insert(0, new ListItem("Root Menu", "0"));
                int num = 0;
                chkPublished.Checked = true;
                txtMenuOrder.Text    = num.ToString();
            }
        }
        protected void Delete_Click(object sender, EventArgs e)
        {
            LinkButton          btn         = (LinkButton)sender;
            int                 DirectionID = int.Parse(btn.CommandArgument);
            DirectionController dc          = new DirectionController();

            dc.DeleteDirection(DirectionID);
            rptDirections.DataSource = dc.GetDirections();
            rptDirections.DataBind();
        }