protected void btnSaveTemplate_Click(object sender, EventArgs e) { Page.Validate("vgPropTemplate"); if (!Page.IsValid) { return; } ActiveTemplate.Name = txtTemplateName.Text; ActiveTemplate.Description = txtDescription.Text; ActiveTemplate.Group = (PropertyTemplateGroup)Enum.Parse(typeof(PropertyTemplateGroup), cmbCategories.SelectedValue); ActiveTemplate.Owner = Page.User.Identity.Name; try { ActiveTemplate.Commit(); TemplateCreated?.Invoke(this, new PropertyTemplateEventArgs(ActiveTemplate)); // Clear for the next ActiveTemplate = new UserPropertyTemplate(); ToForm(); cpeNewTemplate.ClientState = "true"; } catch (MyFlightbookValidationException ex) { lblErr.Text = ex.Message; } }
public virtual void OnTemplateCreated(GeneratedTemplateInfos e) { TemplateCreated?.Invoke(this, e); }