protected void grdMain_DeleteCommand(object source, DataGridCommandEventArgs e) { string id = e.CommandArgument.ToString(); FormDocument fd = FormDocument.Load(mc.Name, id); fd.Delete(); if (id == FormController.GeneralViewFormType || id == FormController.GeneralViewHistoryFormType) { MetaDataWrapper.RemoveClassAttribute(mc, "HasCompositePage"); } CHelper.RequireDataBind(); }
protected void grdMain_RowCommand(object source, DataGridCommandEventArgs e) { if (e == null) { return; } if (e.CommandName == deleteCommand) { string id = e.CommandArgument.ToString(); FormDocument fd = FormDocument.Load(mc.Name, id); fd.Delete(); if (id == FormController.GeneralViewFormType || id == FormController.GeneralViewHistoryFormType) { MetaDataWrapper.RemoveClassAttribute(mc, "HasCompositePage"); } } else if (e.CommandName == resetCommand) { string id = e.CommandArgument.ToString(); FormDocument fd = FormDocument.Load(mc.Name, id); fd.Delete(); } else if (e.CommandName == recreateCommand) { string id = e.CommandArgument.ToString(); FormDocument fd = FormDocument.Load(mc.Name, id); if (fd != null) { fd = FormController.ReCreateFormDocument(mc.Name, fd.Name); //ListApp Fix if (ListManager.MetaClassIsList(mc.Name) && fd.FormTable.Rows[0].Cells[0].Sections.Count > 0) { fd.FormTable.Rows[0].Cells[0].Sections[0].BorderType = (int)BorderType.None; fd.FormTable.Rows[0].Cells[0].Sections[0].ShowLabel = false; } } } CHelper.RequireDataBind(); }