示例#1
0
 protected void btnLimpiar_Click(object sender, EventArgs e)
 {
     FuncionesBasesWeb.CargarComboTipoDocumento(ddlTipoDocumento);
     txtPaciente.Text       = String.Empty;
     txtNomPaciente.Text    = String.Empty;
     txtApePatPaciente.Text = String.Empty;
     txtApeMatPaciente.Text = String.Empty;
     txtFechaSolicitud.Text = String.Empty;
     //chkEnviado.Checked = false;
 }
示例#2
0
        protected void btnExportar_Click(object sender, EventArgs e)
        {
            string    FechaD, FechaH;
            DataTable dt = new DataTable();

            if (txtFechaDesde.Text.Length > 0)
            {
                if (txtFechaHasta.Text.Length > 0)
                {
                    if (Convert.ToDateTime(txtFechaDesde.Text) < Convert.ToDateTime(txtFechaHasta.Text) || Convert.ToDateTime(txtFechaDesde.Text) == Convert.ToDateTime(txtFechaHasta.Text))
                    {
                        /*********************************************/
                        FechaD = string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime((txtFechaDesde.Text.Substring(6, 4) + "/" + txtFechaDesde.Text.Substring(3, 2) + "/" + txtFechaDesde.Text.Substring(0, 2))));
                        FechaH = string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime((txtFechaHasta.Text.Substring(6, 4) + "/" + txtFechaHasta.Text.Substring(3, 2) + "/" + txtFechaHasta.Text.Substring(0, 2))));

                        dt = objSolicitudAutorizacionBL.SolicitudAutorizacion_Reportes(Convert.ToInt32(EstablecimientoId), FechaD, FechaH);

                        if (dt.Rows.Count > 0)
                        {
                            FuncionesBasesWeb.ExportarExcel3(dt);
                        }
                        else
                        {
                            script = "No existen Solicitudes para [Exportar]";
                            ScriptManager.RegisterStartupScript(this.ScriptManager1, GetType(), "Mostrar Mensaje", "Dialog('" + script + "');", true);
                        }
                        /*********************************************/
                    }
                    else
                    {
                        script = "La [Fecha Desde] debe ser menor que la [Fecha Hasta]";
                        ScriptManager.RegisterStartupScript(this.ScriptManager1, GetType(), "Mostrar Mensaje", "Dialog('" + script + "');", true);
                        txtFechaDesde.Text = String.Empty;
                        txtFechaDesde.Focus();
                    }
                }
                else
                {
                    script = "Ingrese una Fecha [Hasta]";
                    ScriptManager.RegisterStartupScript(this.ScriptManager1, GetType(), "Mostrar Mensaje", "Dialog('" + script + "');", true);
                }
            }
            else
            {
                script = "Ingrese una Fecha [Desde]";
                ScriptManager.RegisterStartupScript(this.ScriptManager1, GetType(), "Mostrar Mensaje", "Dialog('" + script + "');", true);
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["Codigo"] = null;
            Session["Est"]    = null;

            //int Estado = Convert.ToInt32(Request.QueryString["val"]);
            int Estado = 0;

            Estado = 1;//Convert.ToInt32(HttpContext.Current.Session["Val"]);

            if (Session["login"] == null & Session["password"] == null)
            {
                Response.Redirect("~/FrmLogin.aspx");
            }
            else
            {
                if (!IsPostBack)
                {
                    FuncionesBasesWeb.CargarComboTipoDocumento(ddlTipoDocumento);

                    lblUsuario.Text         = Session["login"].ToString();
                    lblEstablecimiento.Text = Session["Descripcion"].ToString();

                    if (ddlTipoDocumento.SelectedValue.ToString() == "0")
                    {
                        txtPaciente.ReadOnly = true;
                    }
                    else
                    {
                        txtPaciente.ReadOnly = false;
                    }

                    if (Estado == 1)
                    {
                        chkEnviado.Checked = true;
                        CargarSolicitud();
                        HideColumns(gvListaSolicitudes);
                    }
                    else
                    {
                        CargarSolicitud();
                        HideColumns(gvListaSolicitudes);
                    }
                }
            }
        }