protected void BtnSave_Click(object sender, EventArgs e) { LblErr.Text = ""; LblOk.Text = ""; try { WebConfigEntry o1 = new WebConfigEntry(); if (base.CurrentKey == "") { form2obj(o1); new WebConfigManager().Insert(o1); } else { o1 = new WebConfigManager().GetByKey(base.CurrentKey); //precarico i campi esistenti e nn gestiti dal form form2obj(o1); new WebConfigManager().Update(o1); } Grid1.DataBind(); LblOk.Text = RenderSuccess( Utility.GetLabel("RECORD_SAVED_MSG")); MultiView1.ActiveViewIndex = 0; } catch (Exception e1) { LblErr.Text = RenderError( Utility.GetLabel("RECORD_ERR_MSG") + "<br />" + e1.ToString()); } finally { } }
private void editRow(string recordId) { LblOk.Text = ""; LblErr.Text = ""; clearForm(); base.CurrentKey = recordId; if (!string.IsNullOrEmpty(base.CurrentKey)) { WebConfigEntry obj = new WebConfigEntry(); obj = new WebConfigManager().GetByKey(base.CurrentKey); obj2form(obj); } MultiView1.ActiveViewIndex = 1; }