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); } }
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; } }
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; } }
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; } }
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; } } }
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); } }
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; } } }
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; } } } } }
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; } }
protected void gvStaffPermission_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e) { }
protected void dgBook_CommandButtonInitialize(object sender, DevExpress.Web.ASPxGridViewCommandButtonEventArgs e) { }