protected void btnAdd_Click(object sender, EventArgs e) { string err = string.Empty; try { if (Valid(out err)) { var entity = new DTO.PiezasArteDTO(); FormsHelper.FillEntity(tblControls, entity); if (!trDuracion.Visible) { (entity as DTO.PiezasArteDTO).Duracion = null; } Business.PiezasArte.Create(entity, Productos); pnlControls.Visible = false; RefreshGrid(gv); } else { throw new Exception(err); } } catch (Exception ex) { FormsHelper.MsgError(lblError, ex); } }
void Pieza_SelectedIndexChanged(object sender, EventArgs e) { DTO.PiezasArteDTO pieza = CRUDHelper.Read( string.Format("IdentifPieza = '{0}'", ucIdentifPieza.SelectedValue), BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.PiezasArte)); if ((pieza != null && pieza.Duracion.HasValue && pieza.Duracion > 0)) { trDuracion.Visible = true; spDuracion.Value = pieza.Duracion; } else { trDuracion.Visible = false; spDuracion.Value = null; } }
protected void btnAdd_Click(object sender, EventArgs e) { string err = string.Empty; try { if (Valid(out err)) { var entity = new DTO.PiezasArteDTO(); FormsHelper.FillEntity(tblControls, entity); if (!trDuracion.Visible) (entity as DTO.PiezasArteDTO).Duracion = null; Business.PiezasArte.Create(entity, Productos); pnlControls.Visible = false; RefreshGrid(gv); } else { throw new Exception(err); } } catch (Exception ex) { FormsHelper.MsgError(lblError, ex); } }