Exemplo n.º 1
0
        protected void btn_guardar(object sender, EventArgs e)
        {
            string ficha    = Request.Form["txtficha2"];
            string folio    = Request.Form["txtfolio2"];
            string tipo_doc = cbotipo_doc2.SelectedValue;
            string num_doc  = Request.Form["txtnum_doc2"];
            string nombres  = Request.Form["txtnombres2"];


            string msg = new PacientesNE().Registrar_Paciente(ficha, folio, tipo_doc, num_doc, nombres);

            if (Convert.ToInt32(msg) > 0)
            {
                string res = "Estimado Usuario, La Paciente se ha registrado correctamente";
                ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + res + "');", true);

                txtficha.Value                 = ficha;
                txtfolio.Value                 = folio;
                cbotipo_doc.SelectedIndex      = Convert.ToInt32(tipo_doc);
                txtnum_doc.Value               = num_doc;
                txtnombre.Value                = nombres;
                cbotipo_busqueda.SelectedIndex = 0;
                txtfiltro.Value                = "";
                Session["_Cod_paciente"]       = msg;
                habilitar();
            }
            else
            {
                string res = "Estimado Usuario, error al registrar el paciente";
                ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + res + "');", true);
            }
        }
Exemplo n.º 2
0
        protected void btnbuscar(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            int    id     = 0;
            string tipo   = cbotipo_busqueda.SelectedValue;
            string filtro = Request.Form["txtfiltro"];

            Pacientes pac = new PacientesNE().Cargar_paciente(Convert.ToInt32(tipo), filtro);

            id = pac._Id_pac;
            if (id > 0)
            {
                txtficha.Value            = Convert.ToString(pac._Ficha);
                txtfolio.Value            = Convert.ToString(pac._Folio);
                cbotipo_doc.SelectedIndex = Convert.ToInt32(pac._Tipo_doc);
                txtnum_doc.Value          = Convert.ToString(pac._Num_doc);
                txtnombre.Value           = Convert.ToString(pac._Nombres);
                Session["_Cod_paciente"]  = pac._Id_pac;
                habilitar();
                cbotipo_doc.Enabled = false;
            }
            else
            {
                limpiar_formulario();
                string res = "Estimado Usuario, El Paciente no se encontro en la Base de datos, Desea Registrarlo ?";
                ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup2('" + res + "');", true);
            }
        }
Exemplo n.º 3
0
        protected void buscar_paciente()
        {
            string cod_paciente = Session["Cod_Paciente"].ToString();


            Pacientes pac = new PacientesNE().Cargar_paciente(cod_paciente);

            txtficha.Value             = Convert.ToString(pac._Ficha);
            txtfolio.Value             = Convert.ToString(pac._Folio);
            cbodocumento.SelectedIndex = Convert.ToInt32(pac._Tipo_doc);
            txtnum_doc.Value           = Convert.ToString(pac._Num_doc);
            txtpaciente.Value          = Session["Nom_Paciente"].ToString();
            txtcama.Value       = Session["Cama"].ToString();
            txthabitacion.Value = Session["Habitacion"].ToString();
            txtservicio.Value   = Session["Nom_Servicio"].ToString();
            // txtnombre.Value = Convert.ToString(pac._Nombres);
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                if (Session["Usuario"] != null)
                {
                    user        = Session["Usuario"].ToString();
                    paciente    = Session["_Cod_paciente"].ToString();
                    nombre.Text = user.ToUpper();
                    Cargar_tipo_busqueda();
                    Cargar_tipo_documento();
                    pedido = validar_pedido();
                    if (paciente.Equals("") || pedido.Equals(0))
                    {
                        deshabilitar();
                    }
                    else
                    {
                        habilitar();

                        Pacientes pac = new PacientesNE().Cargar_paciente(paciente);
                        txtficha.Value               = Convert.ToString(pac._Ficha);
                        txtfolio.Value               = Convert.ToString(pac._Folio);
                        cbotipo_doc.SelectedIndex    = Convert.ToInt32(pac._Tipo_doc);
                        txtnum_doc.Value             = Convert.ToString(pac._Num_doc);
                        txtnombre.Value              = Convert.ToString(pac._Nombres);
                        btn_limpiar_busqueda.Visible = false;
                        btn_tipo_buscar.Visible      = false;
                    }

                    Session["_Cod_pedido"] = Convert.ToString(pedido);
                }
                else
                {
                    Response.Redirect("Login.aspx");
                    Session["Usuario"] = "";
                }
            }
        }