Ejemplo n.º 1
0
        protected void UiVistaClientesNuevos_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
        {
            try
            {
                if (Session["UiListaClientesNuevos"] == null)
                {
                    return;
                }

                if (e.VisibleIndex >= 0 && ((IList <Cliente>)Session["UiListaClientesNuevos"]).Count != 0)
                {
                    if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.SelectCheckbox)
                    {
                        if (UiVistaClientesNuevos.GetRowValues(e.VisibleIndex, "IS_POSTED_ERP").ToString() == Enums.GetStringValue(ScoutingEnviadoErp.Enviado) || UiVistaClientesNuevos.GetRowValues(e.VisibleIndex, "STATUS").ToString() == Enums.GetStringValue(ScoutingEstado.Aceptado))
                        {
                            e.Visible = false;
                            e.Enabled = false;
                        }
                        if (UiVistaClientesNuevos.GetRowValues(e.VisibleIndex, "IS_POSTED_ERP").ToString() == Enums.GetStringValue(ScoutingEnviadoErp.Errado) || UiVistaClientesNuevos.GetRowValues(e.VisibleIndex, "STATUS").ToString() == Enums.GetStringValue(ScoutingEstado.Aceptado))
                        {
                            e.Visible = false;
                            e.Enabled = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                EstablecerError(ex.Message, UiVistaClientesNuevos);
            }
        }
Ejemplo n.º 2
0
 protected void generico_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
 {
     if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Update || e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Cancel)
     {
         e.Visible = false;
     }
 }
Ejemplo n.º 3
0
        protected void dgLessonsTutors_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
        {
            string perms = (new PermissionService().GetPermissionsActivity(new SessionManager().GetUserId(this.Session), "smCourseSubjTutorSchedule"));

            switch (e.ButtonType)
            {
            case ColumnCommandButtonType.Edit:
                if (perms.Contains("EDIT"))
                {
                    e.Enabled = true;
                }
                else
                {
                    e.Enabled = false;
                }
                break;

            case ColumnCommandButtonType.Delete:
                if (perms.Contains("DELETE"))
                {
                    e.Enabled = true;
                }
                else
                {
                    e.Enabled = false;
                }
                break;
                //case ColumnCommandButtonType.Select:
                //    if (perms.Contains("VIEW")) { e.Enabled = true; } else { e.Enabled = false; }
                //    break;
            }
        }
Ejemplo n.º 4
0
 protected void dgRecepcionDetalle_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
 {
     if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Update && e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Cancel)
     {
         e.Visible = false;
     }
 }
Ejemplo n.º 5
0
        protected void gvBatches_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
        {
            //string perms = (new PermissionService().GetPermissionsActivity(new SessionManager().GetUserId(this.Session), "smClassLesson"));

            //if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Edit)
            //{ if (perms.Contains("EDIT")) { e.Enabled = true; } else { e.Enabled = false; } }
            //if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Delete)
            //{ if (perms.Contains("DELETE")) { e.Visible = true; } else { e.Enabled = false; } }
            //if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Select)
            //{ if (perms.Contains("VIEW")) { e.Visible = true; } else { e.Enabled = false; } }
        }
Ejemplo n.º 6
0
        protected void gvListSP3M_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
        {
            if (e.VisibleIndex == -1)
            {
                return;
            }

            if (e.ButtonType == ColumnCommandButtonType.Delete)
            {
                e.Visible = DeleteButtonVisibleCriteria((ASPxGridView)sender, e.VisibleIndex);
            }
        }
Ejemplo n.º 7
0
        protected void dgCotizacionDetalle_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
        {
            UnidadDeTrabajo wu = new UnidadDeTrabajo();

            int?[] estateBad = { 36, 47 };
            if (NumeroCotizacion != null && NumeroCotizacion != "Nuevo")
            {
                NumeroCotizacion = Request.QueryString["Id"];
                if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.Update && estateBad.Contains(wu.Cotizacion.ObtenerEstadoCotizacion(int.Parse(NumeroCotizacion))))
                {
                    e.Visible = false;
                }
            }
        }
Ejemplo n.º 8
0
 protected void dgOrdenVentaDetalle_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
 {
     if (NumeroOrdenVenta != null && NumeroOrdenVenta != "Nuevo")
     {
         NumeroOrdenVenta = Request.QueryString["Id"];
         if (NumeroOrdenVenta != null)
         {
             using (var db = new UnidadDeTrabajo())
             {
                 int?estadoOv = db.OrdenVenta.ObtenerEstadoOrdenVenta(int.Parse(NumeroOrdenVenta));
                 if (e.ButtonType == DevExpress.Web.ColumnCommandButtonType.New && estadoOv == 59)
                 {
                     e.Visible = false;
                 }
             }
         }
     }
 }
Ejemplo n.º 9
0
        protected void gvBatchFees_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
        {
            string perms = (new PermissionService().GetPermissionsActivity(new SessionManager().GetUserId(this.Session), "smStudentFees"));

            switch (e.ButtonType)
            {
            case ColumnCommandButtonType.Delete:
                if (perms.Contains("DELETE"))
                {
                    e.Enabled = true;
                }
                else
                {
                    e.Enabled = false;
                }
                break;
            }
        }
Ejemplo n.º 10
0
 protected void gvStaffPermission_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
 {
 }
Ejemplo n.º 11
0
 protected void dgBook_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e)
 {
 }