Example #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                var entity = new DTO.IdentAtencionDTO();
                FormsHelper.FillEntity(tblControls, entity);
                CRUDHelper.Create(entity,
                                  BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.IdentAtencion));

                pnlControls.Visible = false;
                RefreshGrid(gv);
            }
            catch (Exception ex)
            {
                FormsHelper.MsgError(lblError, ex);
            }
        }
Example #2
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string err = string.Empty;

            try
            {
                if (Valid(out err))
                {
                    var entity = new DTO.EspacioContDTO();
                    FormsHelper.FillEntity(tblControls, entity);

                    if (!trIntervalo.Visible)
                    {
                        entity.IdentifIntervalo = null;
                    }

                    if (!trFrecuencia.Visible)
                    {
                        entity.IdentifFrecuencia = null;
                    }

                    if (!trHoraFin.Visible || !trHoraInicio.Visible)
                    {
                        entity.HoraFin    = null;
                        entity.HoraInicio = null;
                    }

                    CRUDHelper.Create(entity, BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.EspacioCont));

                    pnlControls.Visible = false;

                    RefreshGrid(gv);
                }
                else
                {
                    throw new Exception(err);
                }
            }
            catch (Exception ex)
            {
                FormsHelper.MsgError(lblError, ex);
            }
        }
Example #3
0
 private void Create(object entity)
 {
     CRUDHelper.Create(entity, dao);
 }