protected void GuardarBtn_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(Descripcion_Txt.Text.Trim())) { //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Hay campos vacios')", true); ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Hay compas invalidos');", true); return; } Area obj = new Area(); obj.Descripcion = Descripcion_Txt.Text.Trim(); if (string.IsNullOrEmpty(Id_Txt.Text)) { AreaBLL.InsertArea(obj); } else { obj.AreaId = Convert.ToInt32(Id_Txt.Text); AreaBLL.UpdateArea(obj); } Response.Redirect("ListaAreas.aspx"); } catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "alert", "alert('error en la operacion');", true); throw ex; } }
protected void AddArea_Click(object sender, EventArgs e) { try { AreaBLL.InsertArea(OrganizationId, AreaName.Text); } catch (Exception ex) { SystemMessages.DisplaySystemErrorMessage(ex.Message); return; } AreasGridView.DataBind(); SystemMessages.DisplaySystemMessage(Resources.Organization.MessageAddArea); }