protected void GridView_Ubicaciones_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { try { e.Cancel = true; clsUbicaciones Ubicacion = new clsUbicaciones(); FG._NombreUsuario = HttpContext.Current.User.Identity.Name; string IdentityUser = FG.CrearIdentificadorUsuario(FG._NombreUsuario); Ubicacion.IdUbicacion = 0; Ubicacion.NombreProyecto = e.NewValues["NombreProyecto"].ToString(); Ubicacion.IdMunicipio = Convert.ToInt32(e.NewValues["Id_Municipio"].ToString()); Ubicacion.Direccion = e.NewValues["Direccion"] != null ? e.NewValues["Direccion"].ToString() : ""; Ubicacion.AplicaInteres = Convert.ToBoolean(e.NewValues["AplicaInteres"]); Neg.AgregarActualizarUbicacion(Ubicacion, IdentityUser); string MsjSQL = FG.Obtener_MensajeSQL(IdentityUser); if (MsjSQL != "") { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "err_msj", "alert('" + MsjSQL + "');", true); return; } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "err_msj", "alert('Registro creado con éxito.');", true); GridView_Ubicaciones.CancelEdit(); } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }