Exemplo n.º 1
0
    protected void btnsav_Click(object sender, EventArgs e)
    {
        Menumaster _objMM = new Menumaster();

        _objMM.MenuId   = Convert.ToInt32(lblID.Text);
        _objMM.MenuName = txtMname.Text.Trim();
        _objMM.Link     = txtlink.Text.Trim();
        _objMM.IsActive = true;
        try
        {
            _objMM.Save();
            MessageBox("Record saved successfully");
            grdMenuDetails.DataSource = BindGvMenuDetail();
            grdMenuDetails.DataBind();
            pnlMenu.Visible    = true;
            PnlAddMenu.Visible = false;
        }
        catch
        {
        }
    }
Exemplo n.º 2
0
    protected void grdMenuDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        Menumaster _objMM = new Menumaster();

        _objMM.MenuId    = Convert.ToInt32(((Label)grdMenuDetails.Rows[e.RowIndex].FindControl("lblMID")).Text);
        _objMM.MenuName  = ((Label)grdMenuDetails.Rows[e.RowIndex].FindControl("lblName")).Text;
        _objMM.Link      = ((Label)grdMenuDetails.Rows[e.RowIndex].FindControl("lblLink")).Text;
        _objMM.IsActive  = Convert.ToBoolean(false);
        _objMM.IsDeleted = Convert.ToBoolean(true);
        try
        {
            _objMM.Save();
            MessageBox("Your record is Deleted");
            grdMenuDetails.DataSource = BindGvMenuDetail();
            grdMenuDetails.DataBind();
            pnlMenu.Visible    = true;
            PnlAddMenu.Visible = false;
        }
        catch
        {
        }
    }