コード例 #1
0
 private void InitializeComponent()
 {
     this.daSesion          = new System.Data.SqlClient.SqlDataAdapter();
     this.cnn               = new System.Data.SqlClient.SqlConnection();
     this.dsSeguridad       = new ASSMCA.dsSeguridad();
     this.SPD_SESION        = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.dsSeguridad)).BeginInit();
     #region daSesion
     this.daSesion.SelectCommand = this.sqlSelectCommand1;
     this.daSesion.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "SA_USUARIO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Usuario", "PK_Usuario"),
             new System.Data.Common.DataColumnMapping("NB_Login", "NB_Login"),
             new System.Data.Common.DataColumnMapping("NB_Usuario", "NB_Usuario"),
             new System.Data.Common.DataColumnMapping("AP_Usuario", "AP_Usuario"),
             new System.Data.Common.DataColumnMapping("IN_C_PERSONA", "IN_C_PERSONA"),
             new System.Data.Common.DataColumnMapping("IN_READ", "IN_READ"),
             new System.Data.Common.DataColumnMapping("IN_U_PERSONA", "IN_U_PERSONA"),
             new System.Data.Common.DataColumnMapping("IN_C_PERFIL", "IN_C_PERFIL"),
             new System.Data.Common.DataColumnMapping("IN_U_PCORTA", "IN_U_PCORTA"),
             new System.Data.Common.DataColumnMapping("IN_D_PCORTA", "IN_D_PCORTA"),
             new System.Data.Common.DataColumnMapping("IN_U_PERFIL", "IN_U_PERFIL"),
             new System.Data.Common.DataColumnMapping("IN_D_PERFIL", "IN_D_PERFIL"),
             new System.Data.Common.DataColumnMapping("PK_Programa", "PK_Programa"),
             new System.Data.Common.DataColumnMapping("NB_Programa", "NB_Programa"),
             new System.Data.Common.DataColumnMapping("PK_Administracion", "PK_Administracion"),
             new System.Data.Common.DataColumnMapping("NB_Administracion", "NB_Administracion"),
             new System.Data.Common.DataColumnMapping("IN_CambiarPassword", "IN_CambiarPassword"),
             new System.Data.Common.DataColumnMapping("CO_Tipo", "CO_Tipo")
         })
     });
     #endregion
     #region cnn
     this.cnn.ConnectionString = NewSource.connectionString;
     #endregion
     #region dsSeguridad
     this.dsSeguridad.DataSetName = "dsSeguridad";
     this.dsSeguridad.Locale      = new System.Globalization.CultureInfo("en-US");
     #endregion
     #region SPD_SESION
     this.SPD_SESION.CommandText = "dbo.[SPD_SESION]";
     this.SPD_SESION.CommandType = System.Data.CommandType.StoredProcedure;
     this.SPD_SESION.Connection  = this.cnn;
     this.SPD_SESION.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_SESION.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Sesion", System.Data.SqlDbType.UniqueIdentifier, 16));
     #endregion
     #region sqlSelectCommand1
     this.sqlSelectCommand1.CommandText = "[SPC_SESION]";
     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("@NB_Login", System.Data.SqlDbType.VarChar, 10));
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PASSWORD", System.Data.SqlDbType.VarChar, 10));
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Sesion", System.Data.SqlDbType.UniqueIdentifier, 16, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     ((System.ComponentModel.ISupportInitialize)(this.dsSeguridad)).EndInit();
     #endregion
 }
コード例 #2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (this.Session["dsSeguridad"] == null)
     {
         this.Response.Redirect("frmLogon.aspx");
         return;
     }
     this.dsSeguridad = (dsSeguridad)this.Session["dsSeguridad"];
     if (!this.IsPostBack)
     {
         this.DataBind();
     }
 }
コード例 #3
0
 private void InitializeComponent()
 {
     this.cnn = new System.Data.SqlClient.SqlConnection();
     this.SPU_USUARIO_PASSWORD = new System.Data.SqlClient.SqlCommand();
     this.dsSeguridad          = new ASSMCA.dsSeguridad();
     ((System.ComponentModel.ISupportInitialize)(this.dsSeguridad)).BeginInit();
     #region cnn
     this.cnn.ConnectionString = NewSource.connectionString;
     #endregion
     #region SPU_USUARIO_PASSWORD
     this.SPU_USUARIO_PASSWORD.CommandText = "dbo.[SPU_USUARIO_PASSWORD]";
     this.SPU_USUARIO_PASSWORD.CommandType = System.Data.CommandType.StoredProcedure;
     this.SPU_USUARIO_PASSWORD.Connection  = this.cnn;
     this.SPU_USUARIO_PASSWORD.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_USUARIO_PASSWORD.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PK_Usuario", System.Data.SqlDbType.Int, 4));
     this.SPU_USUARIO_PASSWORD.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PASSWORD_VIEJO", System.Data.SqlDbType.VarChar, 10));
     this.SPU_USUARIO_PASSWORD.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PASSWORD_NUEVO", System.Data.SqlDbType.VarChar, 10));
     #endregion
     #region dsSeguridad
     this.dsSeguridad.DataSetName = "dsSeguridad";
     this.dsSeguridad.Locale      = new System.Globalization.CultureInfo("en-US");
     ((System.ComponentModel.ISupportInitialize)(this.dsSeguridad)).EndInit();
     #endregion
 }
コード例 #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {
                if (Request.QueryString["changeProg"] == "yes")
                {
                    this.dsSeguridad = (ASSMCA.dsSeguridad)Session["dsSeguridad"];
                    this.ddlPrograma.DataBind();
                    this.LoginBox.Visible              = false;
                    this.divMsg1.Visible               = false;
                    this.divPrograma.Visible           = true;
                    this.ddlPrograma.Visible           = true;
                    this.btnAutenticarPrograma.Visible = true;
                    this.btnLogin.Visible              = false;
                    return;
                }
                this.txtPassword.Visible           = true;
                this.rfvPassword.Enabled           = true;
                this.ddlPrograma.Visible           = false;
                this.btnAutenticarPrograma.Visible = false;
                this.btnLogin.Visible    = true;
                this.divPrograma.Visible = false;
                if (this.Request.QueryString["logout"] != null)
                {
                    try
                    {
                        this.SPD_SESION.Parameters["@PK_Sesion"].Value = new Guid(this.Session["pk_sesion"].ToString());
                        this.cnn.Open();
                        this.SPD_SESION.ExecuteNonQuery();
                        this.cnn.Close();
                    }
                    catch (Exception ex)
                    {
                        string m = ex.Message;
                        Trace.Warn("Page_Load()", m, ex);

                        if (this.cnn.State != ConnectionState.Closed)
                        {
                            this.cnn.Close();
                        }
                    }
                }
                this.Session["dsSeguridad"]             = null;
                this.Session["pk_administracion"]       = null;
                this.Session["nb_administracion"]       = null;
                this.Session["pk_programa"]             = null;
                this.Session["nb_programa"]             = null;
                this.Session["pk_sesion"]               = null;
                this.Session["nr_rowIndex_dsSeguridad"] = null;
                this.Session["co_tipo"] = null;
            }
            else
            {
                if (this.Session["dsSeguridad"] != null)
                {
                    this.dsSeguridad = (dsSeguridad)this.Session["dsSeguridad"];
                }
                if (this.dsSeguridad.SA_USUARIO.Rows.Count < 1)
                {
                    this.txtPassword.Visible           = true;
                    this.rfvPassword.Enabled           = true;
                    this.ddlPrograma.Visible           = false;
                    this.btnAutenticarPrograma.Visible = false;
                    this.btnLogin.Visible = true;
                }
                else
                {
                    this.lblMsg.Visible                = false;
                    this.txtPassword.Visible           = false;
                    this.rfvPassword.Enabled           = false;
                    this.ddlPrograma.Visible           = true;
                    this.btnAutenticarPrograma.Visible = true;
                    this.btnLogin.Visible              = false;
                }
            }
        }
コード例 #5
0
 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
 }
コード例 #6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.Session["dsSeguridad"] == null)
            {
                this.Response.Redirect("~/Error.aspx?errMsg=sesion");
                return;
            }
            this.pkAdmin       = (PKAdministracion)Convert.ToInt32(this.Session["pk_administracion"].ToString());
            this.m_PK_Programa = Convert.ToInt32(this.Session["PK_Programa"].ToString());
            if (Request.QueryString["fuente"] != null)
            {
                this.btnRegistrar.Visible = true;
                if (Request.QueryString["fuente"].ToString() == "admision")
                {
                    this.Label4.Text = "Búsqueda de pacientes en admisión";
                    HyperLinkColumn hlc = (HyperLinkColumn)this.dgPersonas.Columns[0];
                    hlc.DataNavigateUrlFormatString = "frmVisualizar.aspx?accion=consultar&pk_persona={0}&fuente=admision";
                }
                else if (Request.QueryString["fuente"].ToString() == "evaluacion")
                {
                    this.Label4.Text = "Búsqueda de pacientes en evaluación";
                    HyperLinkColumn hlc = (HyperLinkColumn)this.dgPersonas.Columns[0];
                    hlc.DataNavigateUrlFormatString = "frmVisualizar.aspx?accion=consultar&pk_persona={0}&fuente=evaluacion";
                }
                else if (Request.QueryString["fuente"].ToString() == "alta")
                {
                    this.Label4.Text = "Búsqueda de pacientes en alta";
                    HyperLinkColumn hlc = (HyperLinkColumn)this.dgPersonas.Columns[0];
                    hlc.DataNavigateUrlFormatString = "frmVisualizar.aspx?accion=consultar&pk_persona={0}&fuente=alta";
                }
            }
            else
            {
                this.btnRegistrar.Visible = false;
            }
            if (!this.IsPostBack)
            {
                this.dsSeguridad = (ASSMCA.dsSeguridad)Session["dsSeguridad"];
                this.ddlPrograma.DataBind();
                this.lblMensaje.Visible = true;
                this.dgPersonas.Visible = false;
                DataRow drLKP_Sexo = this.dsPersona.LKP_Sexo.NewRow();
                drLKP_Sexo["PK_Sexo"] = 0;
                drLKP_Sexo["DE_Sexo"] = "";
                this.dsPersona.LKP_Sexo.Rows.Add(drLKP_Sexo);
                DataRow drLKP_Veterano = this.dsPersona.LKP_Veterano.NewRow();
                drLKP_Veterano["PK_Veterano"] = 0;
                drLKP_Veterano["DE_Veterano"] = "";
                this.dsPersona.LKP_Veterano.Rows.Add(drLKP_Veterano);
                DataRow drLKP_GrupoEtnico = this.dsPersona.LKP_GrupoEtnico.NewRow();
                drLKP_GrupoEtnico["PK_GrupoEtnico"] = 0;
                drLKP_GrupoEtnico["DE_GrupoEtnico"] = "";
                this.dsPersona.LKP_GrupoEtnico.Rows.Add(drLKP_GrupoEtnico);
                this.daLkpPersona.Fill(this.dsPersona);
                this.DataBind();
                ListItem li = new ListItem("", "0");
                this.ddlPrograma.Items.Insert(0, li);
            }
            this.dsSeguridad = (dsSeguridad)this.Session["dsSeguridad"];
            int nr_rowIndex_dsSeguridad = Convert.ToInt32(this.Session["nr_rowIndex_dsSeguridad"].ToString());

            if (this.dsSeguridad.SA_USUARIO[nr_rowIndex_dsSeguridad].IN_C_PERSONA < 1) //Si esta denegado
            {
                this.btnRegistrar.Visible = false;
            }
        }