Esempio n. 1
0
        protected void grillaTalleres_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            ASPxGridView grillaTalleres = sender as ASPxGridView;
            int          codigoTaller   = Convert.ToInt32(e.Keys[0]);

            if (ControladorGeneral.ValidarTallerAEliminar(codigoTaller))
            {
                ControladorGeneral.EliminarTaller(codigoTaller);
                grillaTalleres.JSProperties["cpBorrar"] = "Se borró el taller correctamente";
                e.Cancel = true;
                CargarGrillaTalleres(grillaTalleres, Convert.ToInt32(grillaTalleres.GetMasterRowKeyValue()));
            }
            else
            {
                grillaTalleres.JSProperties["cpBorrar"] = "No se puede borrar un taller cuando tiene una entrega asignada";
                e.Cancel = true;
            }
        }