public void Fill() { Miami.Substitute.Dal.Template template = new Miami.Substitute.Dal.Template(); template.LoadByPrimaryKey(TemplateId); TemplateNameLabel.Text = template.Header; TemplateText.Text = template.Text; DeleteButton.Enabled = TemplateText.Text.Length > 0; }
protected void SaveButton_Click(object sender, EventArgs e) { if (TemplateId == 0) return; Miami.Substitute.Dal.Template template = new Miami.Substitute.Dal.Template(); template.LoadByPrimaryKey(TemplateId); template.Text = TemplateText.Text; template.Save(); if (Action != null) Action(sender, e); }
protected void DeleteButton_Click(object sender, EventArgs e) { if (TemplateId == 0) { return; } Miami.Substitute.Dal.Template template = new Miami.Substitute.Dal.Template(); template.LoadByPrimaryKey(TemplateId); template.Text = String.Empty; template.Save(); if (Action != null) { Action(sender, e); } }