protected void FillGrid() { var dt = new DataTable(); dt = BL_ChildMenu.GetChildMenu(2, Convert.ToInt32((string)ddlMainMenu.SelectedValue), ddlRoleName.SelectedValue); if (dt.Rows.Count > 0) { gvAllMenu.DataSource = dt; gvAllMenu.DataBind(); } else { gvAllMenu.DataSource = new string[] { }; gvAllMenu.DataBind(); } dt = BL_MenuAssign.GetMenuAssign(1, Convert.ToInt32((string)ddlMainMenu.SelectedValue), 0, ddlRoleName.SelectedValue); if (dt.Rows.Count > 0) { gvAssignedMenu.DataSource = dt; gvAssignedMenu.DataBind(); } else { gvAssignedMenu.DataSource = dt; gvAssignedMenu.DataBind(); } }
protected void FillGrid() { DataTable dt = new DataTable(); dt = BL_ChildMenu.GetChildMenu(1, Convert.ToInt32((string)ddlMainManu.SelectedValue), ""); if (dt.Rows.Count > 0) { gvChildMenu.DataSource = dt; gvChildMenu.DataBind(); } else { gvChildMenu.DataSource = new string[] { }; gvChildMenu.DataBind(); } }
//protected void gdvCategory_RowCommand(object sender, GridViewCommandEventArgs e) //{ // try // { // if (e.CommandName.Equals("Editone")) // { // int id = int.Parse(e.CommandArgument.ToString()); // int index = Convert.ToInt32(e.CommandArgument); // GridViewRow row = gdvCategory.Rows[index]; // txtChildMenuUrl.Text = ((Label)row.FindControl("lblNavigate")).Text; // Label lblMainMenu = (Label)row.FindControl("lblMainMenu"); // ddlMainManu.SelectedIndex = ddlMainManu.Items.IndexOf(ddlMainManu.Items.FindByText(lblMainMenu.Text)); // txtChildMenuName.Text = ((Label)row.FindControl("lblChildMenu")).Text; // hdnMainID.Value = ((HiddenField)row.FindControl("hdnMainMenu")).Value; // hdnChildID.Value = ((HiddenField)row.FindControl("hdnChildMenu")).Value; // btnSubmit.Text = "Update"; // } // } // catch (Exception ex) // { // msgBox.ShowError(ex.Message); // } //} #region InsUpdDel private void InsUpdDelChildMenu(char Event, int Id) { BL_ChildMenu obj = new BL_ChildMenu(); obj.EVENT = Event; if (txtOrder.Text != "") { obj.Odr = Convert.ToInt32((string)txtOrder.Text); } if (Event == 'I') { obj.ChildMenuID = Id; obj.MainMenuID = Convert.ToInt32((string)ddlMainManu.SelectedValue); obj.MenuName = txtChildMenuName.Text; obj.NavigationURL = txtChildMenuUrl.Text; } else if (Event == 'U') { obj.ChildMenuID = Id; obj.MainMenuID = Convert.ToInt32((string)ddlMainManu.SelectedValue); obj.MenuName = txtChildMenuName.Text; obj.NavigationURL = txtChildMenuUrl.Text; } else { obj.ChildMenuID = Id; obj.MainMenuID = Convert.ToInt32((string)ddlMainManu.SelectedValue); obj.MenuName = txtChildMenuName.Text; obj.NavigationURL = txtChildMenuUrl.Text; } string msg = obj.InsUpdDeleteMainMenu(out Id); if (msg != "") { msgBox.ShowSuccess(msg); } FillGrid(); cleartext(); }