Ejemplo n.º 1
0
        protected void detailGrid_DataSelect(object sender, EventArgs e)
        {
            ASPxGridView gvDetail = (ASPxGridView)sender;

            gvDetail.DataSource = CRUDHelper.ReadAll(string.Format("IdentifFrecuencia = '{0}'", gvDetail.GetMasterRowFieldValues("IdentifFrecuencia")), BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.FrecuenciaDet));

            gvDetail.Columns["IdentifFrecuencia"].Visible = false;

            string semMes = Convert.ToString(gvDetail.GetMasterRowFieldValues("SemMes"));

            gvDetail.Columns["DiaSemana"].Visible = (semMes.Trim().ToLower() == "semana");
            gvDetail.Columns["Dia"].Visible       = (semMes.Trim().ToLower() != "semana");
        }
Ejemplo n.º 2
0
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = CRUDHelper.ReadAll("", BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.IdentAtencion));
     gv.DataBind();
 }
Ejemplo n.º 3
0
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = CRUDHelper.ReadAll("", DAO);
     gv.DataBind();
 }
Ejemplo n.º 4
0
        protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "btnAdd":

                    FormsHelper.ClearControls(tblControls, new DTO.FrecuenciaDTO());
                    FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add);

                    pnlDias.Visible = false;
                    Detalles        = new List <DTO.FrecuenciaDetDTO>();

                    RefreshAbmGrid(gvABM);

                    pnlControls.Visible    = true;
                    pnlControls.HeaderText = "Agregar Registro";
                    trDias.Visible         = true;
                    rbSemMes.Enabled       = true;

                    break;

                case "btnEdit":

                    if (FormsHelper.GetSelectedId(gv) != null)
                    {
                        FormsHelper.ClearControls(tblControls, new DTO.FrecuenciaDTO());
                        var entity = CRUDHelper.Read(FormsHelper.GetSelectedId(gv).Value, BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.Frecuencia));
                        FormsHelper.FillControls(entity, tblControls);
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit);

                        Detalles = CRUDHelper.ReadAll(string.Format("IdentifFrecuencia = '{0}'", entity.IdentifFrecuencia), BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.FrecuenciaDet));

                        rbSemMes.Enabled = (Detalles.Count == 0);

                        rbSemMesChanged();

                        gvABM.Attributes.Add("IdentifFrecuencia", entity.IdentifFrecuencia);
                        trDias.Visible = true;
                        RefreshAbmGrid(gvABM);

                        pnlControls.Attributes.Add("RecId", entity.RecId.ToString());
                        pnlControls.Visible    = true;
                        pnlControls.HeaderText = "Modificar Registro";
                    }
                    else
                    {
                        pnlControls.Visible = false;
                    }
                    break;

                case "btnDelete":
                    rbSemMes.Enabled = (Detalles.Count == 0);
                    if (FormsHelper.GetSelectedId(gv) != null)
                    {
                        FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Delete);
                        pnlControls.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).ToString());
                        pnlControls.Visible    = true;
                        pnlControls.HeaderText = "Eliminar Registros";
                    }
                    else
                    {
                        pnlControls.Visible = false;
                    }
                    break;

                case "btnExport":
                case "btnExportXls":
                    if (ASPxGridViewExporter1 != null)
                    {
                        ASPxGridViewExporter1.GridViewID = "gv";
                    }
                    ASPxGridViewExporter1.WriteXlsToResponse();
                    break;

                case "btnExportPdf":
                    if (ASPxGridViewExporter1 != null)
                    {
                        ASPxGridViewExporter1.GridViewID = "gv";
                    }
                    ASPxGridViewExporter1.WritePdfToResponse();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                FormsHelper.MsgError(lblError, ex);
            }
        }
Ejemplo n.º 5
0
 private void RefreshGrid(ASPxGridView gv)
 {
     gv.DataSource = CRUDHelper.ReadAll("", BusinessMapper.GetDaoByEntity(Entity));
     gv.DataBind();
 }