예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MembershipUser myObject = Membership.GetUser();
     Guid UserID = (Guid)myObject.ProviderUserKey;
     Repositorio repo = new Repositorio();
     SqlDataSource1.SelectParameters.Add("instalacion_id", repo.InstalacionParaUsuario(UserID).Tables[0].Rows[0].ItemArray[0].ToString());//this.User.Identity.Name);
     SqlDataSource1.DataBind();
 }
예제 #2
0
        public static List<Persona> buscarCedula(string searchText)
        {
            CancerDBWebEntities entidad = new CancerDBWebEntities();

            MembershipUser userObject = Membership.GetUser();
            Guid idUsuario = (Guid)userObject.ProviderUserKey;
            Repositorio repo = new Repositorio();
            int id_instalacion = Convert.ToInt32(repo.InstalacionParaUsuario(idUsuario).Tables[0].Rows[0].ItemArray[0]);

            List<Paciente> pacientes = entidad.Pacientes.Where<Paciente>(x => x.cedula.ToUpper() == (searchText.ToUpper()) && x.id_instalacion == id_instalacion).ToList();
            List<Persona> personas = new List<Persona>();

            foreach (Paciente paciente in pacientes)
            {
                personas.Add(new Persona { cedula = paciente.cedula, id = paciente.id.ToString() });
            }

            return personas.Take(10).ToList();
        }
예제 #3
0
        protected void updateLinkButton_Click(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];

            Repositorio repo = new Repositorio();
            CancerDBWebEntities entidad = new CancerDBWebEntities();

            bool identi;

            if (identiCheck.Checked)
                identi = true;
            else
                identi = false;

            MembershipUser myObject = Membership.GetUser();
            Guid UserID = (Guid)myObject.ProviderUserKey;

            int x = entidad.sp_Paciente_Update(
                Convert.ToInt32(id),
                cedulaTextBox.Text.ToUpper(),
                primerNombre.Text.ToUpper(),
                segundoNombre.Text.ToUpper(),
                primerApellido.Text.ToUpper(),
                segundoApellido.Text.ToUpper(),
                (fechaNacimientoTextBox.Text == "" ? null : fechaNacimientoTextBox.Text),
                Convert.ToByte(sexo.SelectedValue),
                (razaRadioButton.Text == "Ninguno" ? null : razaRadioButton.Text),
                numeroTelTextBox.Text,
                provinciaDropDown.SelectedValue + Request.Form[distritoDropDown.UniqueID] + Request.Form[corregimientoDropDown.UniqueID],
                direccionTextBox.Text,
                User.Identity.Name,
                numeroCelTextBox.Text,
                numeroCel2TextBox.Text,
                Convert.ToInt32(repo.InstalacionParaUsuario(UserID).Tables[0].Rows[0].ItemArray[0]),
                identi
                );

            enableElements(false);
            editarLinkButton.Visible = true;
            updateLinkButton.Visible = false;
        }
예제 #4
0
        protected void actualizarLinkButton_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request.QueryString["id"]);

            Repositorio repo = new Repositorio();
            MembershipUser myObject = Membership.GetUser();
            Guid UserID = (Guid)myObject.ProviderUserKey;

               int x =  entidad.sp_Caso_Update(id,
                        fechaDiagnosticoTextBox.Text,
                        (primarioHiddenField.Value == "" ? null : primarioHiddenField.Value),
                        (histologicoHiddenField.Value == "" ? null : histologicoHiddenField.Value),
                        (diferenciacionDropDown.SelectedValue == "" ? null : diferenciacionDropDown.SelectedValue),
                        (extensionDropDown.SelectedValue == "" ? null : extensionDropDown.SelectedValue),
                        (lateralidadDropDown.SelectedValue == "" ? null : lateralidadDropDown.SelectedValue),
                        (baseDropDown.SelectedValue== "" ? null :baseDropDown.SelectedValue),
                        (unidadCheckBox.Checked ? null : (examenHiddenField.Value == "" ? null : examenHiddenField.Value)),
                        (reportaHiddenField.Value== "" ? null :reportaHiddenField.Value),
                         (etapaClinicaDown.SelectedValue== "" ? null :etapaClinicaDown.SelectedValue),
                         (nDown.SelectedValue== "" ? null :nDown.SelectedValue),
                         (tDown.SelectedValue== "" ? null :tDown.SelectedValue),
                         (mDown.SelectedValue== "" ? null :mDown.SelectedValue),
                         Convert.ToInt32(repo.InstalacionParaUsuario(UserID).Tables[0].Rows[0].ItemArray[0]),
                         (unidadCheckBox.Checked ? examenTextBox.Text : null),
                         Convert.ToByte(edadTextBox.Text),
                         Convert.ToByte(edadMesAnio.Text),
                         (fechaDefuncionTextBox.Text == "" ? null : fechaDefuncionTextBox.Text),
                         (unidadCheckBox.Checked ? true : false),
                         User.Identity.Name
                );

               enableElements(false);
               editarLinkButton.Visible = true;
               actualizarLinkButton.Visible = false;
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                MembershipUser myObject = Membership.GetUser();
                Guid UserID = (Guid)myObject.ProviderUserKey;
                Repositorio repo = new Repositorio();
                SqlDataSource1.SelectParameters.Add("instalacion_id", repo.InstalacionParaUsuario(UserID).Tables[0].Rows[0].ItemArray[0].ToString());//this.User.Identity.Name);
                SqlDataSource1.DataBind();

                if (Roles.IsUserInRole("supervisor") || Roles.IsUserInRole("supervisor_temp")) //(Roles.IsUserInRole("administrador") || Roles.IsUserInRole("admin_minsa"))
                {
                    GridView1.Columns[0].Visible = true;
                    // GridView1.Columns[8].Visible = true;
                    GridView1.Columns[9].Visible = true;
                    Button1.Visible = true;
                }
                else
                {

                    GridView1.Columns[0].Visible = false;
                    //  GridView1.Columns[8].Visible = false;
                    GridView1.Columns[9].Visible = false;
                    Button1.Visible = false;
                }

            }

            if (GridView1.Rows.Count == 0)
                Button1.Visible = false;
            else
                Button1.Visible = true;

            foreach (GridViewRow row in GridView1.Rows)
            {
                if (((CheckBox)row.FindControl("AprobarCheckBox")).Checked)
                    cBoxSelections.Add(Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Values["id"].ToString()));
            }

            /*  if (cBoxSelections.Count != 0)
                  foreach (int id in cBoxSelections) {
                      foreach (GridViewRow row in GridView1.Rows) {
                          if (GridView1.DataKeys[row.RowIndex].Values["id"].ToString() == id.ToString())
                              ((CheckBox)row.FindControl("AprobarCheckBox")).Checked = true;
                      }
                  }*/
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {

                MembershipUser myObject = Membership.GetUser();
                Guid UserID = (Guid)myObject.ProviderUserKey;
                Repositorio repo = new Repositorio();

                SqlDataSource1.SelectParameters.Add("instalacion_id", repo.InstalacionParaUsuario(UserID).Tables[0].Rows[0].ItemArray[0].ToString());//this.User.Identity.Name);
                SqlDataSource2.SelectParameters.Add("instalacion_id", repo.InstalacionParaUsuario(UserID).Tables[0].Rows[0].ItemArray[0].ToString());//this.User.Identity.Name);
                SqlDataSource3.SelectParameters.Add("instalacion_id", repo.InstalacionParaUsuario(UserID).Tables[0].Rows[0].ItemArray[0].ToString());//this.User.Identity.Name);

                if (Roles.IsUserInRole("admin_minsa") || Roles.IsUserInRole("administrador"))
                {
                    SqlDataSource1.SelectParameters.Add("admin", "1");
                    SqlDataSource2.SelectParameters.Add("admin", "1");
                    SqlDataSource3.SelectParameters.Add("admin", "1");
                }
                else
                {
                    SqlDataSource1.SelectParameters.Add("admin", "0");
                    SqlDataSource2.SelectParameters.Add("admin", "0");
                    SqlDataSource3.SelectParameters.Add("admin", "0");
                }

                SqlDataSource1.DataBind();
                SqlDataSource2.DataBind();
                SqlDataSource3.DataBind();

            }
        }