Exemplo n.º 1
0
 /// <summary>
 /// Handles the RowCommand event of the grdMain control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewCommandEventArgs"/> instance containing the event data.</param>
 protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         MetaFieldType type = MetaDataWrapper.GetTypeByName(e.CommandArgument.ToString());
         if (!MetaFieldType.IsUsed(type))
         {
             MultiReferenceType.Remove(type);
         }
         BindData();
     }
     if (e.CommandName == "Edit")
     {
         MetaFieldType type = MetaDataWrapper.GetTypeByName(e.CommandArgument.ToString());
         Response.Redirect("~/Apps/MetaDataBase/Pages/Admin/MultiReferenceTypeEdit.aspx?type=" + type.Name);
     }
 }