Beispiel #1
0
        protected void Boton_Borrar_Supervisor_Click(object sender, EventArgs e)
        {
            val.Borrar((int)Session["ID_Paciente"]);
            Formulario_Supervisor.Visible = false;
            string alerta = @"alert('Borrado realizado')";

            // window.location.reload();";

            ScriptManager.RegisterStartupScript(this, typeof(Page), "", alerta, true);
            GridView_Supervisor.DataSource = val.Todos();
            GridView_Supervisor.DataBind();
            return;
        }
Beispiel #2
0
        protected void Boton_Nuevo_Supervisor_Click(object sender, EventArgs e)
        {
            if (Boton_Nuevo_Supervisor.Text == "Nuevo")
            {
                Nombre_Supervisor.Text   = string.Empty;
                Password_Supervisor.Text = string.Empty;
                Apellido_Supervisor.Text = string.Empty;
                Skype_Supervisor.Text    = string.Empty;
                Telefono_Supervisor.Text = string.Empty;
                Pais_Supervisor.Text     = string.Empty;
                Correo_Supervisor.Text   = string.Empty;
                Consulta_Supervisor.Text = string.Empty;

                Boton_Nuevo_Supervisor.Text = "Insertar";
                return;
            }

            if (Boton_Nuevo_Supervisor.Text == "Insertar")
            {
                if (Nombre_Supervisor.Text == string.Empty || Apellido_Supervisor.Text == string.Empty || Correo_Supervisor.Text == string.Empty)
                {
                    return;
                }



                if (Consulta_Supervisor.Text == string.Empty)
                {
                    Consulta_Supervisor.Text = DateTime.Now.ToString();
                }
                try
                {
                    DateTime valr = Convert.ToDateTime(Consulta_Supervisor.Text);
                }
                catch
                {
                    return;
                }
                val.Insertar((int)Session["ID_Paciente"], Nombre_Supervisor.Text, Apellido_Supervisor.Text, Celular_Supervisor.Text, Telefono_Supervisor.Text, Pais_Supervisor.Text, Consulta_Supervisor.Text, Correo_Supervisor.Text);

                Boton_Nuevo_Supervisor.Text   = "Nuevo";
                Formulario_Supervisor.Visible = false;
                string alerta = @"alert('Inserción realizada')";
                // window.location.reload();";

                ScriptManager.RegisterStartupScript(this, typeof(Page), "", alerta, true);
                GridView_Supervisor.DataSource = val.Todos();
                GridView_Supervisor.DataBind();
                return;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     user = (Staff)Session["User"];
     if (!IsPostBack)
     {
         if (user.RoleId == 4)
         {
             GridView_Store.Visible      = true;
             GridView_Supervisor.Visible = false;
             GridView_Store.DataSource   = preparePurchaseController.GetOrderListByStoreClerk();
             GridView_Store.DataBind();
         }
         if (user.RoleId == 5 || user.RoleId == 6)
         {
             GridView_Store.Visible         = false;
             GridView_Supervisor.Visible    = true;
             GridView_Supervisor.DataSource = preparePurchaseController.GetOrderList();
             GridView_Supervisor.DataBind();
         }
     }
 }
Beispiel #4
0
        protected void Boton_Actualizar_Supervisor_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime valr = Convert.ToDateTime(Consulta_Supervisor.Text);
            }
            catch
            {
                return;
            }

            val.Actualizar((int)Session["ID_Paciente"], Nombre_Supervisor.Text, Apellido_Supervisor.Text, Celular_Supervisor.Text, Telefono_Supervisor.Text, Pais_Supervisor.Text, Consulta_Supervisor.Text, Correo_Supervisor.Text);
            Formulario_Supervisor.Visible = false;
            string alerta1 = @"alert('Actualización realizada')";

            // window.location.reload();";

            ScriptManager.RegisterStartupScript(this, typeof(Page), "", alerta1, true);
            GridView_Supervisor.DataSource = val.Todos();
            GridView_Supervisor.DataBind();
            return;
        }
Beispiel #5
0
 public void Mostrar_Datos_Dios(int Pagina)
 {
     GridView_Supervisor.DataSource = val.Todos().Skip(Pagina * 10).Take(10);;
     GridView_Supervisor.DataBind();
 }