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); } }
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); } }
private void Create(object entity) { CRUDHelper.Create(entity, dao); }