Esempio n. 1
0
 protected void GridView_Ubicaciones_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
 {
     try
     {
         e.Cancel = true;
         clsUbicaciones Ubicacion = new clsUbicaciones();
         FG._NombreUsuario = HttpContext.Current.User.Identity.Name;
         string IdentityUser = FG.CrearIdentificadorUsuario(FG._NombreUsuario);
         Ubicacion.IdUbicacion    = Convert.ToInt32(e.Keys["IdUbicacion"]);
         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 actualizado con éxito.');", true);
             GridView_Ubicaciones.CancelEdit();
         }
     }
     catch (Exception Ex)
     {
         FG.Controlador_Error(Ex, Page.Response);
     }
 }
Esempio n. 2
0
 protected void GridView_Ubicaciones_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e)
 {
     try
     {
         if (e.ButtonID == "Bloques")
         {
             Session["IdUbicacion"]           = GridView_Ubicaciones.GetRowValues(e.VisibleIndex, "IdUbicacion");
             ASPxPopup_Bloques.ShowOnPageLoad = true;
         }
     }
     catch (Exception Ex)
     {
         FG.Controlador_Error(Ex, Page.Response);
     }
 }