protected void btnSave_Click(object sender, EventArgs e) { if (ValidarCampos()) { try { tblFaturaEmail table = new tblFaturaEmail(); table.cmpIdFaturaEmail = ViewState["cmpidFaturaEmail"].ToString(); table.cmpNoFuncionario = txtNomeFuncionario.Text.ToString(); table.cmpDcEmail = txtDcEmail.Text.ToString(); table.cmpNuNivelEmail = rdbPerfil.SelectedValue.ToString(); table.cmpNoUsuario = ((HzLibGeneral.Util.HzLogin)Session["login"]).cmpNoUsuario.TrimEnd(); table.Save(Global.GetConnection()); MsgBox.ShowMessage("Registro atualizado com sucesso!", "Aviso"); btnPesquisar_Click(sender, e); btnDesvincular.Enabled = true; btnVincular.Enabled = true; this.ModalPopupExtender2.Show(); } catch (Exception ex) { Global.ShowError(Global.Title, ex); } } }
protected void lnkExcluir_Click(object sender, EventArgs e) { LinkButton lnkExcluir = sender as LinkButton; GridViewRow gvrow = (GridViewRow)lnkExcluir.NamingContainer; ViewState["cmpidFaturaEmail"] = lnkExcluir.CommandArgument.ToString(); tblFaturaEmail table = new tblFaturaEmail(); table.cmpIdFaturaEmail = ViewState["cmpidFaturaEmail"].ToString(); table.cmpNoUsuario = ((HzLibGeneral.Util.HzLogin)Session["login"]).cmpNoUsuario; if (table.Delete(Global.GetConnection())) { MsgBox.ShowMessage("Registro excluído com sucesso!", "Aviso"); btnPesquisar_Click(sender, e); } }