protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Sucursal obj = new WSGestion.MOD_Sucursal(); obj.SUC_nombre = txt_nombre.Value; obj.SUC_telefono = txt_telefono.Value; obj.SUC_direccion = txt_direccion.Value; obj.SUC_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.SUC_id_sucursal = Convert.ToInt32(txt_codigo.Value); wsgest.CRE_Sucursal(obj); Response.Redirect("frm_Grid_Sucursal.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Sucursal obj = new WSGestion.MOD_Sucursal(); obj.SUC_nombre = txt_nombre.Value; obj.SUC_telefono = txt_telefono.Value; obj.SUC_direccion = txt_direccion.Value; obj.SUC_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.SUC_id_sucursal = Convert.ToInt32(txt_codigo.Value); wsgest.UPD_Sucursal(obj); Response.Redirect("frm_Grid_Sucursal.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }