Exemple #1
0
        public static List<TipoPrimarioHistologia> CodigoTipoHistologico(string searchText, int maxResults, int code)
        {
            Repositorio repo = new Repositorio();
            List<TipoPrimarioHistologia> names = new List<TipoPrimarioHistologia>();
            DataSet sitiosDset = repo.GetTiposHistologicos();

            foreach (DataRow row in sitiosDset.Tables[0].Rows)
                names.Add(new TipoPrimarioHistologia { id = row.ItemArray[2].ToString(), code = row.ItemArray[0].ToString(), desc = row.ItemArray[1].ToString() });

            if (code == 1)
            {
                var result = from n in names
                             where n.code.ToUpper().Contains(searchText.ToUpper())
                             orderby n.code
                             select n;

                return result.Take(maxResults).ToList();
            }
            else
            {
                var result = from n in names
                             where RemoveDiacritics(n.desc).ToUpper().Contains(searchText.ToUpper())
                             orderby n.desc
                             select n;

                return result.Take(maxResults).ToList();
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in GridView1.Rows)
            {
                CheckBox cb = (CheckBox)row.FindControl("AprobarCheckBox");
                Repositorio repo = new Repositorio();
                DataSet dset = new DataSet();

                dset.Tables.Add();    //agregamos una tabla al dataser
                dset.Tables[0].Rows.Add(); //se agrega una fila a la tabla creada

                dset.Tables[0].Columns.Add("id");
                dset.Tables[0].Columns.Add("aprobado");
                dset.Tables[0].Columns.Add("username");

                dset.Tables[0].Rows[0]["id"] = GridView1.DataKeys[row.RowIndex].Values["id"].ToString();

                if (cb.Checked)
                {
                    dset.Tables[0].Rows[0]["aprobado"] = true;
                    dset.Tables[0].Rows[0]["username"] = User.Identity.Name;
                    repo.AprobarDesaprobarCasoMinsa(dset);

                }

            }
            GridView1.DataBind();

            if (GridView1.Rows.Count == 0)
                Button1.Visible = false;
            else
                Button1.Visible = true;
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //AprobarDesaprobarCasoInst

            if (e.CommandName == "Select")
            {
            Repositorio repo = new Repositorio();
            DataSet dset = new DataSet();

            dset.Tables.Add();                  //agregamos una tabla al dataser
            dset.Tables[0].Rows.Add();          //se agrega una fila a la tabla creada

            dset.Tables[0].Columns.Add("id");
            dset.Tables[0].Columns.Add("aprobado");

            dset.Tables[0].Rows[0]["id"] = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Values["id"].ToString();

                int intFila = Convert.ToInt32(e.CommandArgument.ToString());

                //Obtener DataKey de la fila
                string idCaso = GridView1.DataKeys[intFila].Value.ToString();

                //Dirigire a la página editar
                Response.Redirect("~/Hospital/InfoCaso.aspx?id=" + idCaso.Trim());

            }
            if (e.CommandName == "desaprobar")
            {

                idHiddenField.Value = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Values["id"].ToString();
                userHiddenField.Value = User.Identity.Name;

                Modal.Show();
            }
        }
Exemple #4
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();
 }
Exemple #5
0
        protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Repositorio repo = new Repositorio();
            DataSet dset = new DataSet();

            dset.Tables.Add();    //agregamos una tabla al dataser
            dset.Tables[0].Rows.Add(); //se agrega una fila a la tabla creada

            dset.Tables[0].Columns.Add("id");
            dset.Tables[0].Columns.Add("aprobado");
            dset.Tables[0].Columns.Add("username");

            if (e.CommandName == "Select")
            {

                //int intFila = Convert.ToInt32(e.CommandArgument.ToString());

                //Obtener DataKey de la fila
                string idCaso = GridView2.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Values["id"].ToString();

                //Dirigire a la página editar
                Response.Redirect("~/Hospital/InfoCaso.aspx?id=" + idCaso.Trim());

            }

            else if (e.CommandName == "noaprobar")
            {
                // int intFila = Convert.ToInt32(e.CommandArgument.ToString());

                //Obtener DataKey de la fila
                // string idCaso = GridView2.DataKeys[intFila].Value.ToString();
                dset.Tables[0].Rows[0]["id"] = GridView2.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Values["id"].ToString();
                dset.Tables[0].Rows[0]["aprobado"] = false;
                dset.Tables[0].Rows[0]["username"] = User.Identity.Name;
                repo.AprobarDesaprobarCasoInst(dset);
                GridView2.DataBind();
            }

            else if (e.CommandName == "eliminar")
            {

                //int intFila = Convert.ToInt32(e.CommandArgument.ToString());
                //Obtener DataKey de la fila
                string idCaso = GridView2.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Values["id"].ToString();

                if (repo.EliminarCaso(idCaso, User.Identity.Name))
                {
                }

                GridView2.DataBind();
            }
        }
Exemple #6
0
        protected void eventosGridview_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "detalles")
            {

                Repositorio repo = new Repositorio();
                //DataSet dset = new DataSet();
                int intFila = Convert.ToInt32(e.CommandArgument.ToString());
                //Obtener DataKey de la fila
                string idMensaje = eventosGridview.DataKeys[intFila].Value.ToString();
                repo.mensajeLeido(Convert.ToInt32(idMensaje));
                Response.Redirect("~/Hospital/MensajeDetalles.aspx?id=" + idMensaje);
            }
        }
Exemple #7
0
        public static List<CodificacionInstalacion> Instalacion(string searchText, int maxResults)
        {
            Repositorio repo = new Repositorio();
            List<CodificacionInstalacion> names = new List<CodificacionInstalacion>();
            DataSet sitiosDset = repo.GetInstalaciones();

            foreach (DataRow row in sitiosDset.Tables[0].Rows)
                names.Add(new CodificacionInstalacion { id = row.ItemArray[2].ToString(), code = row.ItemArray[0].ToString(), desc = row.ItemArray[1].ToString() });

            var result = from n in names
                         where RemoveDiacritics(n.desc).ToUpper().Contains(searchText.ToUpper())
                         orderby n.desc
                         select n;

            return result.Take(maxResults).ToList();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Mensajes.id,asunto,observaciones ,Caso.numero_caso,Mensajes.fecha,caso_id
                DataSet dset = null;
                Repositorio repo = new Repositorio();
                string id = Request.QueryString["id"];

                dset = repo.mensajePorId(Convert.ToInt32(id));

                casoLabel.Text = dset.Tables[0].Rows[0].ItemArray[3].ToString();
                fechaLabel.Text = dset.Tables[0].Rows[0].ItemArray[4].ToString();
                asuntoTextBox.Text = dset.Tables[0].Rows[0].ItemArray[1].ToString();
                observacionesTextBox.Text = dset.Tables[0].Rows[0].ItemArray[2].ToString();
            }
        }
        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();
        }
Exemple #10
0
        //protected void CreateUserWizard1_ActiveStepChanged(object sender, EventArgs e)
        //{
        //    // Have we JUST reached the Complete step?
        //    if (CreateUserWizard1.ActiveStep.Title == "Completar")
        //    {
        //        // Reference the SpecifyRolesStep WizardStep
        //        WizardStep SpecifyRolesStep = CreateUserWizard1.FindControl("SpecifyRolesStep") as WizardStep;
        //        // Reference the RoleList CheckBoxList
        //        RadioButtonList RoleList = SpecifyRolesStep.FindControl("RoleList") as RadioButtonList;
        //        // Add the checked roles to the just-added user
        //        foreach (ListItem li in RoleList.Items)
        //        {
        //            if (li.Selected)
        //                Roles.AddUserToRole(CreateUserWizard1.UserName, li.Text);
        //        }
        //    }
        //}
        protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            Repositorio repo = new Repositorio();

            DataSet dset = new DataSet();
            dset.Tables.Add();
            dset.Tables[0].Rows.Add();

            dset.Tables[0].Columns.Add("username");
            dset.Tables[0].Columns.Add("usuario");
            dset.Tables[0].Columns.Add("id_institucion");

            dset.Tables[0].Rows[0]["usuario"] = CreateUserWizard1.UserName;

            dset.Tables[0].Rows[0]["username"] = User.Identity.Name;

            CreateUserWizardStep wizardStep = CreateUserWizard1.FindControl("CreateUserWizardStep1") as CreateUserWizardStep;

            if (Roles.IsUserInRole("administrador") || Roles.IsUserInRole("admin_regional"))
            {

                HiddenField institucionHidden = wizardStep.ContentTemplateContainer.FindControl("HiddenInstalacionId") as HiddenField;
                dset.Tables[0].Rows[0]["id_institucion"] = institucionHidden.Value;
            }
            else
            {
                //obtener institucion de usuario actual
                dset.Tables[0].Rows[0]["id_institucion"] = repo.ObtenerIdInstalacionPorNombreUsuario(User.Identity.Name).Tables[0].Rows[0].ItemArray[0];
            }
            repo.InsertarInstalacionUsuario(dset);

            TextBox nombre = wizardStep.ContentTemplateContainer.FindControl("Nombre") as TextBox;
            TextBox apellido = wizardStep.ContentTemplateContainer.FindControl("Apellido") as TextBox;

            ProfileUser pc = ProfileUser.GetUserProfile(CreateUserWizard1.UserName);

            //ProfileBase pc = ProfileCommon.Create(CreateUserWizard1.UserName, true);

            pc.FirstName = nombre.Text;
            pc.LastName = apellido.Text;
            pc.Save();
        }
        protected void aceptarButton_Click(object sender, EventArgs e)
        {
            Repositorio repo = new Repositorio();
            DataSet dset = new DataSet();

            dset.Tables.Add();    //agregamos una tabla al dataser
            dset.Tables[0].Rows.Add(); //se agrega una fila a la tabla creada

            dset.Tables[0].Columns.Add("id");
            dset.Tables[0].Columns.Add("username");
            dset.Tables[0].Columns.Add("aprobado");

            dset.Tables[0].Rows[0]["id"] = idHiddenField.Value;
            dset.Tables[0].Rows[0]["username"] = User.Identity.Name;
            dset.Tables[0].Rows[0]["aprobado"] = false;

            if (repo.AprobarDesaprobarCasoMinsa(dset))
            {
                repo.enviarMensaje(asuntoTextBox.Text, observacionesTextBox.Text, Convert.ToInt32(idHiddenField.Value), true);
                GridViewReportes.DataBind();
            }
        }
        protected void aceptarButton_Click(object sender, EventArgs e)
        {
            Repositorio repo = new Repositorio();
            DataSet dset = new DataSet();

            dset.Tables.Add();    //agregamos una tabla al dataser
            dset.Tables[0].Rows.Add(); //se agrega una fila a la tabla creada

            dset.Tables[0].Columns.Add("id");
            dset.Tables[0].Columns.Add("username");
            dset.Tables[0].Columns.Add("aprobado");

            dset.Tables[0].Rows[0]["id"] = idHiddenField.Value;
            dset.Tables[0].Rows[0]["username"] = userHiddenField.Value;
            dset.Tables[0].Rows[0]["aprobado"] = false;

            if (repo.AprobarDesaprobarCasoMinsa(dset))
            {
                repo.enviarMensaje(asuntoTextBox.Text,observacionesTextBox.Text,Convert.ToInt32(idHiddenField.Value),true);
            }

            GridView1.DataBind();

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

            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;
                    }
                }
        }
Exemple #13
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();

            }
        }
Exemple #14
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;
        }
Exemple #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                updateLinkButton.Visible = false;

                Repositorio repo = new Repositorio();
                string id = Request.QueryString["id"];

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

                //preguntamos si el caso pertenece a la institucion

                //el caso no pertenece a la institución
                int? pertenece = entidad.sp_PacientePerteneceAInst(UserID, Convert.ToInt32(id)).SingleOrDefault();

                if (pertenece == 0 && (Roles.IsUserInRole("administrador") || Roles.IsUserInRole("admin_minsa") || Roles.IsUserInRole("admin_regional")))
                {
                    editarLinkButton.Visible = false;
                    casoHide1.Visible = false;
                    casoHide2.Visible = false;
                }
                else if (pertenece == 0)
                    Response.Redirect("~/Hospital/Error1.aspx");

                DataSet dset = repo.BuscarPaciente(id);

                //usado por el gridview
                idHiddenField.Value = id;

                if (dset.Tables[0].Rows.Count >= 1)
                {

                    if ((bool)dset.Tables[0].Rows[0].ItemArray[15] == true)
                    {
                        cedulaLabel.Text = "IDENTIFICADOR";
                        identiCheck.Checked = true;
                    }

                    cedulaTextBox.Text = dset.Tables[0].Rows[0].ItemArray[1].ToString();

                    primerNombre.Text = dset.Tables[0].Rows[0].ItemArray[2].ToString();
                    segundoNombre.Text = dset.Tables[0].Rows[0].ItemArray[3].ToString();
                    primerApellido.Text = dset.Tables[0].Rows[0].ItemArray[4].ToString();
                    segundoApellido.Text = dset.Tables[0].Rows[0].ItemArray[5].ToString();

                    fechaNacimientoTextBox.Text = String.Format("{0:dd/MM/yyyy}", dset.Tables[0].Rows[0].ItemArray[6]);

                    sexo.SelectedValue = dset.Tables[0].Rows[0].ItemArray[7].ToString();

                    if (!(dset.Tables[0].Rows[0].ItemArray[8].ToString()==""))
                        razaRadioButton.SelectedValue = dset.Tables[0].Rows[0].ItemArray[8].ToString();

                    numeroTelTextBox.Text = dset.Tables[0].Rows[0].ItemArray[9].ToString();

                    direccionTextBox.Text = dset.Tables[0].Rows[0].ItemArray[11].ToString();

                    provinciaDropDown.SelectedValue = dset.Tables[0].Rows[0].ItemArray[10].ToString().Substring(0, 2);

                    numeroCelTextBox.Text = dset.Tables[0].Rows[0].ItemArray[12].ToString();
                    numeroCel2TextBox.Text = dset.Tables[0].Rows[0].ItemArray[13].ToString();

                    distritoDropDown.DataSource = repo.Distritos_SelectedProvincia(dset.Tables[0].Rows[0].ItemArray[10].ToString().Substring(0, 2));
                    distritoDropDown.DataTextField = "distrito";
                    distritoDropDown.DataValueField = "cod_distrito";
                    distritoDropDown.SelectedValue = dset.Tables[0].Rows[0].ItemArray[10].ToString().Substring(2, 2);
                    distritoDropDown.DataBind();

                    corregimientoDropDown.DataSource = repo.Corregimiento_SelectProvinciaDistrito(dset.Tables[0].Rows[0].ItemArray[10].ToString().Substring(0, 2), dset.Tables[0].Rows[0].ItemArray[10].ToString().Substring(2, 2));
                    corregimientoDropDown.DataTextField = "corregimiento";
                    corregimientoDropDown.DataValueField = "cod_corregimiento";
                    corregimientoDropDown.SelectedValue = dset.Tables[0].Rows[0].ItemArray[10].ToString().Substring(4, 2);
                    corregimientoDropDown.DataBind();

                    this.enableElements(false);

                    CasosGridView.DataBind();

                }

                InfoMultiView.SetActiveView(UsuarioView);
            }
        }
        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;
                      }
                  }*/
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //AprobarDesaprobarCasoInst

            Repositorio repo = new Repositorio();
            DataSet dset = new DataSet();

            dset.Tables.Add();    //agregamos una tabla al dataser
            dset.Tables[0].Rows.Add(); //se agrega una fila a la tabla creada

            dset.Tables[0].Columns.Add("id");
            dset.Tables[0].Columns.Add("aprobado");
            dset.Tables[0].Columns.Add("username");

            dset.Tables[0].Rows[0]["id"] = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Values["id"].ToString();

            if (e.CommandName == "aprobar")
            {
                dset.Tables[0].Rows[0]["aprobado"] = true;
                dset.Tables[0].Rows[0]["username"] = User.Identity.Name;
                repo.AprobarDesaprobarCasoInst(dset);
                GridView1.DataBind();
            }
            else if (e.CommandName == "noaprobar")
            {

                dset.Tables[0].Rows[0]["aprobado"] = false;
                dset.Tables[0].Rows[0]["username"] = User.Identity.Name;
                if (repo.AprobarDesaprobarCasoInst(dset))
                {
                    /*  foreach (GridViewRow row in GridView1.Rows)
                      {
                          if (((CheckBox)row.FindControl("AprobarCheckBox")).Checked && !(GridView1.DataKeys[row.RowIndex].Values["id"].ToString() == GridView1.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Values["id"].ToString()))
                              cBoxSelections.Add( Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Values["id"].ToString()) );
                      }*/
                }

                GridView1.DataBind();

                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;
                        }
                    }
            }

            else if (e.CommandName == "eliminar")
            {

                int intFila = Convert.ToInt32(e.CommandArgument.ToString());
                //Obtener DataKey de la fila
                string idCaso = GridView1.DataKeys[intFila].Value.ToString();

                if (repo.EliminarCaso(idCaso, User.Identity.Name))
                {
                }

                GridView1.DataBind();
            }

            else if (e.CommandName == "Select")
            {
                int intFila = Convert.ToInt32(e.CommandArgument.ToString());

                //Obtener DataKey de la fila
                string idCaso = GridView1.DataKeys[intFila].Value.ToString();

                //Dirigire a la página editar
                Response.Redirect("~/Hospital/InfoCaso.aspx?id=" + idCaso.Trim());

            }

            if (GridView1.Rows.Count == 0)
                Button1.Visible = false;
            else
                Button1.Visible = true;
        }
Exemple #18
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;
        }
        void populateUsersGridView()
        {
            /* UsersGridView.DataSource = null;
            UsersGridView.DataBind();*/

            Repositorio repo = new Repositorio();

            if (!(Roles.IsUserInRole("administrador")) && !(Roles.IsUserInRole("admin_regional")))
                UsersGridView.DataSource = repo.UsuarioPorRolEInstalacion(RolesDropDown.SelectedValue, Convert.ToInt32(repo.ObtenerIdInstalacionPorNombreUsuario(User.Identity.Name).Tables[0].Rows[0].ItemArray[0]));
            else
                UsersGridView.DataSource = repo.UsuarioPorRolEInstalacion(RolesDropDown.SelectedValue, Convert.ToInt32 (instalacionDropDown.SelectedValue) );
            //UsersGridView.DataSource = Roles.GetUsersInRole(RolesDropDown.SelectedValue);
            UsersGridView.DataBind();
        }