protected void ASPxGridView_Bloques_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { try { e.Cancel = true; if (Session["IdUbicacion"] == null) { ASPxPopup_Bloques.ShowOnPageLoad = false; ASPxGridView_Bloques.CancelEdit(); return; } clsBloques Bloque = new clsBloques(); FG._NombreUsuario = HttpContext.Current.User.Identity.Name; string IdentityUser = FG.CrearIdentificadorUsuario(FG._NombreUsuario); Bloque.IdBloque = 0; Bloque.IdUbicacion = Convert.ToInt32(Session["IdUbicacion"]); Bloque.Bloque = e.NewValues["Bloque"].ToString(); Bloque.Observaciones = e.NewValues["Observaciones"] != null ? e.NewValues["Observaciones"].ToString() : ""; Neg.AgregarActualizarBloque(Bloque, 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); ASPxGridView_Bloques.CancelEdit(); } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }