protected void GuadarButton_Click(object sender, EventArgs e) { if (Cuenta_Id_DropDownList.SelectedValue == condicion) { return; } BLL.DepositosBLL depositosBLL = new BLL.DepositosBLL(); if (Id_DropDownList.Text.Equals(condicion)) { if (depositosBLL.Guardar(GetDeposito())) { ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['success']('Guardado');", addScriptTags: true); NuevoButton_Click(sender, e); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['danger']('No se pudo Guardar');", addScriptTags: true); } } else { if (depositosBLL.Modificar(GetDeposito())) { ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['success']('Modificado');", addScriptTags: true); NuevoButton_Click(sender, e); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['danger']('No se pudo Guardar');", addScriptTags: true); } } }
protected void EliminarButton_Click(object sender, EventArgs e) { int id = 0; BLL.DepositosBLL depositosBLL = new BLL.DepositosBLL(); if (Id_DropDownList.SelectedValue != condicion) { id = Convert.ToInt32(Id_DropDownList.SelectedValue); } else { return; } if (!Id_DropDownList.Text.Equals(condicion)) { if (depositosBLL.Eliminar(id)) { ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['success']('Eliminado');", addScriptTags: true); NuevoButton_Click(sender, e); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "toastr_message", script: "toastr['danger']('No se pudo Eliminar');", addScriptTags: true); } } }