protected void VerTodosEpisodios()
 {
     this.dsPersona = (ASSMCA.pacientes.dsPersona) this.Session["dsPersona"];
     if (this.dsPersona.SA_EPISODIOS.Rows.Count == 0)
     {
         this.daEpisodios.SelectCommand.Parameters["@PK_Persona"].Value = Convert.ToInt32(this.dsPersona.SA_PERSONA[0]["PK_Persona"].ToString());
         this.daEpisodios.Fill(this.dsPersona);
     }
     this.dvwEpisodios.Table     = this.dsPersona.SA_EPISODIOS;
     this.dvwEpisodios.RowFilter = "";
     this.dgEpisodios.DataSource = this.dvwEpisodios;
     this.dgEpisodios.DataBind();
     this.Session["dsPersona"] = this.dsPersona;
     if (this.dvwEpisodios.Count > 0)
     {
         this.dgEpisodios.Visible = true;
         this.lblMsgGrid.Visible  = false;
     }
     else
     {
         this.dgEpisodios.Visible = false;
         this.lblMsgGrid.Visible  = true;
         this.lblMsgGrid.Text     = "La persona no tiene ningún tipo de episodio registrado en el sistema.";
     }
 }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.Session["dsSeguridad"] == null)
            {
                this.Response.Redirect("~/Error.aspx?errMsg=sesion");
                return;
            }
            int PK_Episodio = Convert.ToInt32(this.Request.QueryString["pk_episodio"].ToString());

            this.dsPersona             = (ASSMCA.pacientes.dsPersona) this.Session["dsPersona"];
            this.dvwEpisodio.Table     = this.dsPersona.SA_EPISODIOS;
            this.dvwEpisodio.RowFilter = "PK_Episodio =" + PK_Episodio.ToString();
            this.dsPersona.SA_PERFILES.Rows.Clear();
            this.daPerfiles.SelectCommand.Parameters["@PK_Episodio"].Value = PK_Episodio;
            this.daPerfiles.Fill(this.dsPersona);
            this.DataBind();
            if (Request.QueryString["fuente"] != null)
            {
                //NOTE::[Evaluacion ley 22 - (Presentencia -> Admisi'on)] -- [Alcoholismo Amb. - (Admisi'ones <-- Charlas --> Altas)]
                bool esProgramaDeEvaluacionLey22 = EsProgramaDeEvaluacionLey22((PKPrograma)(Convert.ToInt32(Session["pk_programa"].ToString())));
                if (Request.QueryString["fuente"].ToString() == "evaluacion" && this.lblEstado.Text == "Abierto")
                {
                    if (esProgramaDeEvaluacionLey22)
                    {
                        this.btnEvaluacion.Visible = false;
                    }
                    else
                    {
                        this.btnEvaluacion.Visible = true;
                    }
                }
                else
                {
                    this.btnEvaluacion.Visible = false;
                }
                if (Request.QueryString["fuente"].ToString() == "alta" && this.lblEstado.Text == "Abierto")
                {
                    if (esProgramaDeEvaluacionLey22)
                    {
                        this.btnAlta.Visible       = false;
                        this.btnEvaluacion.Visible = false;
                    }
                    else
                    {
                        this.btnAlta.Visible = true;
                    }
                }
                else
                {
                    this.btnAlta.Visible = false;
                }
            }
            else
            {
                this.btnAlta.Visible       = false;
                this.btnEvaluacion.Visible = false;
            }
        }
 protected bool CheckIfEpisodeWithSameProgramOpenExists(int pk_programa)
 {
     this.dsPersona = (ASSMCA.pacientes.dsPersona) this.Session["dsPersona"];
     if (this.dsPersona.SA_EPISODIOS.Rows.Count == 0)
     {
         this.daEpisodios.SelectCommand.Parameters["@PK_Persona"].Value = Convert.ToInt32(this.dsPersona.SA_PERSONA[0]["PK_Persona"].ToString());
         this.daEpisodios.Fill(this.dsPersona);
     }
     this.dvwEpisodios.Table     = this.dsPersona.SA_EPISODIOS;
     this.dvwEpisodios.RowFilter = "( ES_Episodio IS NULL OR ES_Episodio = 0 ) AND FK_Programa = " + pk_programa;
     this.Session["dsPersona"]   = this.dsPersona;
     if (this.dvwEpisodios.Count > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
 private void InitializeComponent()
 {
     this.daPerfiles        = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.cnn         = new System.Data.SqlClient.SqlConnection();
     this.dsPersona   = new ASSMCA.pacientes.dsPersona();
     this.dvwEpisodio = new System.Data.DataView();
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dvwEpisodio)).BeginInit();
     #region daPerfiles
     this.daPerfiles.SelectCommand = this.sqlSelectCommand1;
     this.daPerfiles.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "SA_PERFILES", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_NR_Perfil", "PK_NR_Perfil"),
             new System.Data.Common.DataColumnMapping("FE_Perfil", "FE_Perfil"),
             new System.Data.Common.DataColumnMapping("TI_Perfil", "TI_Perfil"),
             new System.Data.Common.DataColumnMapping("URL", "URL")
         })
     });
     #endregion
     #region sqlSelectCommand1
     this.sqlSelectCommand1.CommandText = "[SPR_PERFILES]";
     this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand1.Connection  = this.cnn;
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Episodio", System.Data.SqlDbType.Int, 4));
     #endregion
     #region cnn
     this.cnn.ConnectionString = NewSource.connectionString;
     #endregion
     #region dsPersona
     this.dsPersona.DataSetName = "dsPersona";
     this.dsPersona.Locale      = new System.Globalization.CultureInfo("en-US");
     #endregion
     #region dvwEpisodio
     this.dvwEpisodio.Table = this.dsPersona.SA_EPISODIOS;
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dvwEpisodio)).EndInit();
     #endregion
 }
 private void InitializeComponent()
 {
     this.daPersona         = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.cnn               = new System.Data.SqlClient.SqlConnection();
     this.dsPersona         = new ASSMCA.pacientes.dsPersona();
     this.daEpisodios       = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.dvwEpisodios      = new System.Data.DataView();
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dvwEpisodios)).BeginInit();
     this.dgEpisodios.SortCommand   += new System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.dgEpisodios_SortCommand);
     this.dgEpisodios.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgEpisodios_ItemDataBound);
     #region daPersona
     this.daPersona.SelectCommand = this.sqlSelectCommand1;
     this.daPersona.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "SA_PERSONA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Persona", "PK_Persona"),
             new System.Data.Common.DataColumnMapping("NR_SeguroSocial", "NR_SeguroSocial"),
             new System.Data.Common.DataColumnMapping("FK_Sexo", "FK_Sexo"),
             new System.Data.Common.DataColumnMapping("DE_Sexo", "DE_Sexo"),
             new System.Data.Common.DataColumnMapping("AP_Primero", "AP_Primero"),
             new System.Data.Common.DataColumnMapping("AP_Segundo", "AP_Segundo"),
             new System.Data.Common.DataColumnMapping("NB_Primero", "NB_Primero"),
             new System.Data.Common.DataColumnMapping("NB_Segundo", "NB_Segundo"),
             new System.Data.Common.DataColumnMapping("FE_Nacimiento", "FE_Nacimiento"),
             new System.Data.Common.DataColumnMapping("NR_Edad", "NR_Edad"),
             new System.Data.Common.DataColumnMapping("FK_Veterano", "FK_Veterano"),
             new System.Data.Common.DataColumnMapping("DE_Veterano", "DE_Veterano"),
             new System.Data.Common.DataColumnMapping("FK_GrupoEtnico", "FK_GrupoEtnico"),
             new System.Data.Common.DataColumnMapping("DE_GrupoEtnico", "DE_GrupoEtnico"),
             new System.Data.Common.DataColumnMapping("FK_Sesion", "FK_Sesion"),
             new System.Data.Common.DataColumnMapping("TI_Edicion", "TI_Edicion"),
             new System.Data.Common.DataColumnMapping("FE_Edicion", "FE_Edicion"),
             new System.Data.Common.DataColumnMapping("NR_Expediente", "NR_Expediente")
         }),
         new System.Data.Common.DataTableMapping("Table1", "SA_RAZA_PERSONA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("FK_Raza", "FK_Raza"),
             new System.Data.Common.DataColumnMapping("DE_Raza", "DE_Raza")
         })
     });
     #endregion
     #region sqlSelectCommand1
     this.sqlSelectCommand1.CommandText = "[SPR_PERSONA]";
     this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand1.Connection  = this.cnn;
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Persona", System.Data.SqlDbType.Int, 4));
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Programa", System.Data.SqlDbType.TinyInt, 1));
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IN_Raza", System.Data.SqlDbType.Bit, 1));
     #endregion
     #region cnn
     this.cnn.ConnectionString = NewSource.connectionString;
     #endregion
     #region dsPersona
     this.dsPersona.DataSetName = "dsPersona";
     this.dsPersona.Locale      = new System.Globalization.CultureInfo("en-US");
     #endregion
     #region daEpisodios
     this.daEpisodios.SelectCommand = this.sqlSelectCommand2;
     this.daEpisodios.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "SA_EPISODIOS", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Episodio", "PK_Episodio"),
             new System.Data.Common.DataColumnMapping("FK_Persona", "FK_Persona"),
             new System.Data.Common.DataColumnMapping("FK_Programa", "FK_Programa"),
             new System.Data.Common.DataColumnMapping("NB_Programa", "NB_Programa"),
             new System.Data.Common.DataColumnMapping("FE_Episodio", "FE_Episodio"),
             new System.Data.Common.DataColumnMapping("ES_Episodio", "ES_Episodio"),
             new System.Data.Common.DataColumnMapping("DE_ES_Episodio", "DE_ES_Episodio"),
             new System.Data.Common.DataColumnMapping("IN_Metadona", "IN_Metadona"),
             new System.Data.Common.DataColumnMapping("DE_Metadona", "DE_Metadona"),
             new System.Data.Common.DataColumnMapping("NR_Perfiles", "NR_Perfiles")
         })
     });
     #endregion
     #region sqlSelectCommand2
     this.sqlSelectCommand2.CommandText = "[SPR_EPISODIOS]";
     this.sqlSelectCommand2.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand2.Connection  = this.cnn;
     this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Persona", System.Data.SqlDbType.Int, 4));
     #endregion
     #region dvwEpisodios
     this.dvwEpisodios.Table = this.dsPersona.SA_EPISODIOS;
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dvwEpisodios)).EndInit();
     #endregion
 }
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (this.Session["dsSeguridad"] == null)
     {
         this.Response.Redirect("~/Error.aspx?errMsg=sesion");
         return;
     }
     if (!this.IsPostBack)
     {
         int PK_Persona  = Convert.ToInt32(Request.QueryString["pk_persona"].ToString());
         int PK_Programa = Convert.ToInt32(this.Session["pk_programa"].ToString());
         this.daPersona.SelectCommand.Parameters["@PK_Persona"].Value  = PK_Persona;
         this.daPersona.SelectCommand.Parameters["@PK_Programa"].Value = PK_Programa;
         this.daPersona.SelectCommand.Parameters["@IN_Raza"].Value     = true;
         this.dsPersona.SA_PERSONA.Rows.Clear();
         this.daPersona.Fill(this.dsPersona);
         this.DataBind();
         this.Session["dsPersona"] = this.dsPersona;
         this.dgEpisodios.Visible  = false;
         this.SetRazas();
         if (Request.QueryString["fuente"] != null)
         {
             if (Request.QueryString["accion"].ToString() == "consultar")
             {
                 this.lblMensaje.Visible   = false;
                 this.btnModificar.Visible = false;
                 this.btnRegresar.Visible  = false;
             }
             else
             {
                 this.btnRegistrar.Visible = true;
                 this.btnModificar.Visible = false;
                 this.btnRegresar.Visible  = false;
             }
             if (Request.QueryString["fuente"].ToString() == "admision")
             {
                 if (!IsDead(PK_Persona.ToString()) && !HasProfileOpenInResidentialOrHospitalization(PK_Persona.ToString()) && !CheckIfEpisodeWithSameProgramOpenExists(PK_Programa) && GenderTest(PK_Programa))
                 {
                     this.btnRegistrar.Visible = true;
                 }
                 HyperLinkColumn hlc = (HyperLinkColumn)this.dgEpisodios.Columns[0];
                 hlc.DataNavigateUrlFormatString = "../Episodios/frmVisualizar.aspx?pk_episodio={0}&fuente=admision";
             }
             else if (Request.QueryString["fuente"].ToString() == "evaluacion")
             {
                 HyperLinkColumn hlc = (HyperLinkColumn)this.dgEpisodios.Columns[0];
                 hlc.DataNavigateUrlFormatString = "../Episodios/frmVisualizar.aspx?pk_episodio={0}&fuente=evaluacion";
             }
             else if (Request.QueryString["fuente"].ToString() == "alta")
             {
                 HyperLinkColumn hlc = (HyperLinkColumn)this.dgEpisodios.Columns[0];
                 hlc.DataNavigateUrlFormatString = "../Episodios/frmVisualizar.aspx?pk_episodio={0}&fuente=alta";
             }
         }
         else if (Request.QueryString["accion"].ToString() == "registrar")
         {
             this.btnRegistrar.Visible = false;
             this.btnModificar.Visible = false;
             this.btnRegresar.Visible  = true;
             this.lblMsgGrid.Text      = "La persona no posee episodios registrados.";
         }
         else if (Request.QueryString["accion"].ToString() == "consultar")
         {
             this.lblMensaje.Visible   = false;
             this.btnRegistrar.Visible = false;
             this.btnModificar.Visible = true;
             this.btnRegresar.Visible  = false;
         }
     }
     else
     {
         this.dsPersona = (ASSMCA.pacientes.dsPersona) this.Session["dsPersona"];
     }
     this.VerTodosEpisodios();
 }
Пример #7
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (this.Session["dsSeguridad"] == null)
     {
         this.Response.Redirect("~/Error.aspx?errMsg=sesion");
         return;
     }
     if (this.Session["pk_administracion"].ToString() == "1")
     {
         ddlVeterano.Enabled       = false;
         ddlVeterano.SelectedValue = "3";
     }
     this.m_PK_Programa = Convert.ToInt32(this.Session["pk_programa"].ToString());
     this.rvAñoNacimiento.MaximumValue = DateTime.Now.Year.ToString();
     this.rvAñoNacimiento.MinimumValue = DateTime.Now.AddYears(-100).Year.ToString();
     this.rvAñoNacimiento.ErrorMessage = "El año de la fecha de nacimiento tiene que se un entero entre " + DateTime.Now.Year.ToString() + " y " + DateTime.Now.AddYears(-100).Year + ".";
     if (!this.IsPostBack)
     {
         if (Request.QueryString["accion"].ToString() == "registrar")
         {
             this.btnRegistrar.Visible         = true;
             this.btnActualizarPersona.Visible = false;
             this.daLkpPersona.Fill(this.dsPersona);
             this.DataBind();
             Session["dsPersona"] = this.dsPersona;
             this.ddlVeterano.Items.Insert(0, new ListItem("", "0"));
             this.ddlVeterano.SelectedValue = "0";
         }
         else if (Request.QueryString["accion"].ToString() == "editar")
         {
             this.btnRegistrar.Visible         = false;
             this.btnActualizarPersona.Visible = true;
             this.lTituloPrincipal.Text        = "Modificación de paciente";
             this.dsPersona = (ASSMCA.pacientes.dsPersona)Session["dsPersona"];
             this.daLkpPersona.Fill(this.dsPersona);
             this.dvwRazasNoSeleccionadas.Table = this.dsPersona.LKP_Raza;
             this.DataBind();
             if (this.dsPersona.SA_PERSONA[0] != null)
             {
                 this.lblIUP.Text             = this.dsPersona.SA_PERSONA[0]["PK_Persona"].ToString();
                 this.txtExpediente.Text      = this.dsPersona.SA_PERSONA[0]["NR_Expediente"].ToString();
                 this.txtNSS1.Text            = this.dsPersona.SA_PERSONA[0]["NR_SeguroSocial"].ToString().Substring(0, 3);
                 this.txtNSS2.Text            = this.dsPersona.SA_PERSONA[0]["NR_SeguroSocial"].ToString().Substring(3, 2);
                 this.txtNSS3.Text            = this.dsPersona.SA_PERSONA[0]["NR_SeguroSocial"].ToString().Substring(5, 4);
                 this.txtPrimerApellido.Text  = this.dsPersona.SA_PERSONA[0]["AP_Primero"].ToString();
                 this.txtSegundoApellido.Text = this.dsPersona.SA_PERSONA[0]["AP_Segundo"].ToString();
                 this.txtPrimerNombre.Text    = this.dsPersona.SA_PERSONA[0]["NB_Primero"].ToString();
                 this.txtSegundoNombre.Text   = this.dsPersona.SA_PERSONA[0]["NB_Segundo"].ToString();
                 DateTime fe = DateTime.Parse(this.dsPersona.SA_PERSONA[0]["FE_Nacimiento"].ToString());
                 this.ddlMes.SelectedValue         = fe.Month.ToString();
                 this.ddlDía.SelectedValue         = fe.Day.ToString();
                 this.txtAño.Text                  = fe.Year.ToString();
                 this.ddlSexo.SelectedValue        = this.dsPersona.SA_PERSONA[0]["FK_Sexo"].ToString();
                 this.ddlGrupoEtnico.SelectedValue = this.dsPersona.SA_PERSONA[0]["FK_GrupoEtnico"].ToString();
                 this.ddlVeterano.SelectedValue    = this.dsPersona.SA_PERSONA[0]["FK_Veterano"].ToString();
                 this.ActualizarListaRazas();
             }
             else
             {
                 this.Response.Redirect("../pacientes/frmvisualizar.aspx?accion=consultar&pk_persona=" + this.dsPersona.SA_PERSONA[0]["PK_Persona"].ToString());
             }
         }
     }
     else
     {
         this.dsPersona = (ASSMCA.pacientes.dsPersona)Session["dsPersona"];
         this.dvwRazasNoSeleccionadas.Table = this.dsPersona.LKP_Raza;
     }
 }
Пример #8
0
 private void InitializeComponent()
 {
     this.daLkpPersona      = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.cnn       = new System.Data.SqlClient.SqlConnection();
     this.dsPersona = new ASSMCA.pacientes.dsPersona();
     this.dvwRazasNoSeleccionadas = new System.Data.DataView();
     this.SPC_PERSONA             = new System.Data.SqlClient.SqlCommand();
     this.SPC_RAZA_PERSONA        = new System.Data.SqlClient.SqlCommand();
     this.SPD_RAZAS_PERSONA       = new System.Data.SqlClient.SqlCommand();
     this.SPU_PERSONA             = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dvwRazasNoSeleccionadas)).BeginInit();
     #region daLkpPersona
     this.daLkpPersona.SelectCommand = this.sqlSelectCommand1;
     this.daLkpPersona.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "LKP_Sexo", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Sexo", "PK_Sexo"),
             new System.Data.Common.DataColumnMapping("DE_Sexo", "DE_Sexo")
         }),
         new System.Data.Common.DataTableMapping("Table1", "LKP_Veterano", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Veterano", "PK_Veterano"),
             new System.Data.Common.DataColumnMapping("DE_Veterano", "DE_Veterano")
         }),
         new System.Data.Common.DataTableMapping("Table2", "LKP_GrupoEtnico", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_GrupoEtnico", "PK_GrupoEtnico"),
             new System.Data.Common.DataColumnMapping("DE_GrupoEtnico", "DE_GrupoEtnico")
         }),
         new System.Data.Common.DataTableMapping("Table3", "LKP_Raza", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Raza", "PK_Raza"),
             new System.Data.Common.DataColumnMapping("DE_Raza", "DE_Raza")
         })
     });
     #endregion
     #region sqlSelectCommand1
     this.sqlSelectCommand1.CommandText = "[SPR_LKP_PERSONA]";
     this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand1.Connection  = this.cnn;
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     #endregion
     #region cnn
     this.cnn.ConnectionString = NewSource.connectionString;
     #endregion
     #region dsPersona
     this.dsPersona.DataSetName = "dsPersona";
     this.dsPersona.Locale      = new System.Globalization.CultureInfo("en-US");
     #endregion
     #region dvwRazasNoSeleccionadas
     this.dvwRazasNoSeleccionadas.Table = this.dsPersona.LKP_Raza;
     #endregion
     #region SPC_PERSONA
     this.SPC_PERSONA.CommandText = "dbo.[SPC_PERSONA]";
     this.SPC_PERSONA.CommandType = System.Data.CommandType.StoredProcedure;
     this.SPC_PERSONA.Connection  = this.cnn;
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NR_SeguroSocial", System.Data.SqlDbType.VarChar, 9));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Programa", System.Data.SqlDbType.SmallInt, 2));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NR_Expediente", System.Data.SqlDbType.VarChar, 12));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Sexo", System.Data.SqlDbType.TinyInt, 1));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AP_Primero", System.Data.SqlDbType.VarChar, 30));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AP_Segundo", System.Data.SqlDbType.VarChar, 30));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NB_Primero", System.Data.SqlDbType.VarChar, 30));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NB_Segundo", System.Data.SqlDbType.VarChar, 30));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FE_Nacimiento", System.Data.SqlDbType.DateTime, 8));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Veterano", System.Data.SqlDbType.TinyInt, 1));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_GrupoEtnico", System.Data.SqlDbType.TinyInt, 1));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Sesion", System.Data.SqlDbType.UniqueIdentifier, 16));
     this.SPC_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Persona", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     #endregion
     #region SPC_RAZA_PERSONA
     this.SPC_RAZA_PERSONA.CommandText = "dbo.[SPC_RAZA_PERSONA]";
     this.SPC_RAZA_PERSONA.CommandType = System.Data.CommandType.StoredProcedure;
     this.SPC_RAZA_PERSONA.Connection  = this.cnn;
     this.SPC_RAZA_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.SPC_RAZA_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Persona", System.Data.SqlDbType.Int, 4));
     this.SPC_RAZA_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Raza", System.Data.SqlDbType.TinyInt, 1));
     #endregion
     #region SPD_RAZAS_PERSONA
     this.SPD_RAZAS_PERSONA.CommandText = "dbo.[SPD_RAZAS_PERSONA]";
     this.SPD_RAZAS_PERSONA.CommandType = System.Data.CommandType.StoredProcedure;
     this.SPD_RAZAS_PERSONA.Connection  = this.cnn;
     this.SPD_RAZAS_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.SPD_RAZAS_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Persona", System.Data.SqlDbType.Int, 4));
     #endregion
     #region SPU_PERSONA
     this.SPU_PERSONA.CommandText = "dbo.[SPU_PERSONA]";
     this.SPU_PERSONA.CommandType = System.Data.CommandType.StoredProcedure;
     this.SPU_PERSONA.Connection  = this.cnn;
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Persona", System.Data.SqlDbType.Int, 4));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Programa", System.Data.SqlDbType.SmallInt, 2));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NR_Expediente", System.Data.SqlDbType.VarChar, 12));// Cambio: (SqlDbType.Int, 4) Por (SqlDbType.VarChar, 12)
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NR_SeguroSocial", System.Data.SqlDbType.VarChar, 9));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Sexo", System.Data.SqlDbType.TinyInt, 1));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AP_Primero", System.Data.SqlDbType.VarChar, 30));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AP_Segundo", System.Data.SqlDbType.VarChar, 30));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NB_Primero", System.Data.SqlDbType.VarChar, 30));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NB_Segundo", System.Data.SqlDbType.VarChar, 30));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FE_Nacimiento", System.Data.SqlDbType.DateTime, 8));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Veterano", System.Data.SqlDbType.VarChar, 1));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_GrupoEtnico", System.Data.SqlDbType.VarChar, 1));
     this.SPU_PERSONA.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FK_Sesion", System.Data.SqlDbType.UniqueIdentifier, 16));
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dvwRazasNoSeleccionadas)).EndInit();
     #endregion
 }
 private void InitializeComponent()
 {
     this.cnn               = new System.Data.SqlClient.SqlConnection();
     this.daLkpPersona      = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.dsPersona         = new ASSMCA.pacientes.dsPersona();
     this.daPersonas        = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.dsSeguridad       = new ASSMCA.dsSeguridad();
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsSeguridad)).BeginInit();
     #region cnn
     this.cnn.ConnectionString = NewSource.connectionString;
     #endregion
     #region daLkpPersona
     this.daLkpPersona.SelectCommand = this.sqlSelectCommand1;
     this.daLkpPersona.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "LKP_Sexo", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Sexo", "PK_Sexo"),
             new System.Data.Common.DataColumnMapping("DE_Sexo", "DE_Sexo")
         }),
         new System.Data.Common.DataTableMapping("Table1", "LKP_Veterano", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Veterano", "PK_Veterano"),
             new System.Data.Common.DataColumnMapping("DE_Veterano", "DE_Veterano")
         }),
         new System.Data.Common.DataTableMapping("Table2", "LKP_GrupoEtnico", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_GrupoEtnico", "PK_GrupoEtnico"),
             new System.Data.Common.DataColumnMapping("DE_GrupoEtnico", "DE_GrupoEtnico")
         }),
         new System.Data.Common.DataTableMapping("Table3", "LKP_Raza", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Raza", "PK_Raza"),
             new System.Data.Common.DataColumnMapping("DE_Raza", "DE_Raza")
         })
     });
     #endregion
     #region sqlSelectCommand1
     this.sqlSelectCommand1.CommandText = "[SPR_LKP_PERSONA]";
     this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand1.Connection  = this.cnn;
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     #endregion
     #region dsPersona
     this.dsPersona.DataSetName = "dsPersona";
     this.dsPersona.Locale      = new System.Globalization.CultureInfo("en-US");
     #endregion
     #region daPersonas
     this.daPersonas.SelectCommand = this.sqlSelectCommand2;
     this.daPersonas.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "SA_PERSONAS", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Persona", "PK_Persona"),
             new System.Data.Common.DataColumnMapping("NR_SeguroSocial", "NR_SeguroSocial"),
             new System.Data.Common.DataColumnMapping("Apellidos", "Apellidos"),
             new System.Data.Common.DataColumnMapping("Nombres", "Nombres"),
             new System.Data.Common.DataColumnMapping("NR_Edad", "NR_Edad"),
             new System.Data.Common.DataColumnMapping("DE_Sexo", "DE_Sexo"),
             new System.Data.Common.DataColumnMapping("TieneEpisodiosAbiertos", "TieneEpisodiosAbiertos"),
             // new System.Data.Common.DataColumnMapping("DE_GrupoEtnico", "DE_GrupoEtnico"),
             new System.Data.Common.DataColumnMapping("NR_Expediente", "NR_Expediente")
         })
     });
     #endregion
     #region sqlSelectCommand2
     this.sqlSelectCommand2.CommandText = "[SPR_PERSONAS]";
     this.sqlSelectCommand2.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand2.Connection  = this.cnn;
     this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@strWhere", System.Data.SqlDbType.VarChar, 5000));
     #endregion
     #region dsSeguridad
     this.dsSeguridad.DataSetName = "dsSeguridad";
     this.dsSeguridad.Locale      = new System.Globalization.CultureInfo("en-US");
     ((System.ComponentModel.ISupportInitialize)(this.dsPersona)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsSeguridad)).EndInit();
     #endregion
 }