Пример #1
0
        internal override DtoBase PopulateDto(OracleDataReader reader)
        {
            var agenda = new AgendaDto();
            //
            if (!reader.IsDBNull(_ordAgeId)) { agenda.AgeId = reader.GetInt32(_ordAgeId); }
            //
            if (!reader.IsDBNull(_ordAgeHoraDesde)) { agenda.AgeHoraDesde = reader.GetDateTime(_ordAgeHoraDesde); }
            //
            if (!reader.IsDBNull(_ordAgeHoraHasta)) { agenda.AgeHoraHasta = reader.GetDateTime(_ordAgeHoraHasta); }
            //
            if (!reader.IsDBNull(_ordAgeProId)) { agenda.AgeProId = reader.GetInt32(_ordAgeProId); }
            //
            if (!reader.IsDBNull(_ordAgeDiaId)) { agenda.AgeDiaId = reader.GetInt32(_ordAgeDiaId); }
            // IsNew
            agenda.IsNew = false;

            return agenda;
        }
Пример #2
0
        private void ObtenerDatosPantalla(ProfesionalDto profesional)
        {
            #region  Persona -----------------------------------------

            string aux;
            profesional.PsnNroDcto = txtDocumento.Value;
            if (!string.IsNullOrEmpty(txtNombre.Value)) { aux = txtNombre.Value; profesional.PsnNombre = aux.ToUpper(); }
            if (!string.IsNullOrEmpty(txtApellido.Value)) { aux = txtApellido.Value; profesional.PsnApellido = aux.ToUpper(); }
            profesional.PsnFechaNac = txtFecNac.Value;
            profesional.PsnTelefono = txtTel.Value;
            if (!string.IsNullOrEmpty(txtDire.Value)) { aux = txtDire.Value; profesional.PsnDomicilio = aux.ToUpper(); }
            if (!string.IsNullOrEmpty(txtMail.Value)) { aux = txtMail.Value; profesional.PsnEmail = aux.ToUpper(); }
            if (rbM.Checked) { profesional.PsnSexo = "M"; } else if (rbF.Checked) { profesional.PsnSexo = "F"; }
            profesional.ProActivo = "S";

            #endregion

            #region Matriculas --------------------------------------
            if (ViewState["DadaTableMat"] != null)
            {
                var dtMat = (DataTable)ViewState["DadaTableMat"];
                var listaMatricula = new List<ProfesionalMatriculaDto>();
                foreach (DataRow dtRow in dtMat.Rows)
                {
                    var matricula = new ProfesionalMatriculaDto();
                    if (!DBNull.Value.Equals(dtRow[0]))
                    {
                        matricula.PmtId = Convert.ToInt32(dtRow[0].ToString());
                    }
                    matricula.PmtMttId = Convert.ToInt32(dtRow[1].ToString());
                    if (!DBNull.Value.Equals(dtRow["PMTNRO"]))
                    {
                        matricula.PmtNro = dtRow["PMTNRO"].ToString();
                    }
                    listaMatricula.Add(matricula);
                }
                profesional.ProListMatriculas = listaMatricula;
            }
            #endregion

            #region Especialidades ----------------------------------

            profesional.ProListEspecialidades = listaEspecialidades;

            #endregion

            #region Agenda ------------------------------------------
            if (ViewState["DataTableAge"] != null)
            {
                var dtAge = (DataTable)ViewState["DataTableAge"];
                var listaAgenda = new List<AgendaDto>();
                foreach (DataRow dtRow in dtAge.Rows)
                {
                    var agenda = new AgendaDto();
                    if (!DBNull.Value.Equals(dtRow[0])) { agenda.AgeId = Convert.ToInt32(dtRow[0].ToString()); }
                    agenda.AgeDiaId = Convert.ToInt32(dtRow[1].ToString());
                    // Descripcion del tipo de dia = dtRow[2].ToString()
                    agenda.AgeHoraDesde = dtRow[3].ToString();
                    agenda.AgeHoraHasta = dtRow[4].ToString();
                    listaAgenda.Add(agenda);
                }
                profesional.ProListAgenda = listaAgenda;
            }
            #endregion

            var varEstado = Request.QueryString["e"];
            if (varEstado == "B")
            {
                if (lblProId != null) profesional.ProId = Convert.ToInt32(lblProId.Text);
                if (lblPsnId != null) profesional.PsnId = Convert.ToInt32(lblPsnId.Text);

                var opcionSeleccionada = ddlEstado.SelectedItem.ToString();
                if (opcionSeleccionada == "NO")
                    profesional.ProActivo = "N";
                else
                    profesional.ProActivo = "S";
            }
        }