Exemplo n.º 1
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            conexion conec = new conexion();
            string   rango = conec.comprovar(txtusuario.Text, txtcontraseña.Text);

            if (rango == "Padre")
            {
                PADRE form = new PADRE();
                form.CI = conec.ci(txtusuario.Text, txtcontraseña.Text);
                form.Show();
                this.Close();
            }
            else if (rango == "Maestro")
            {
                PROFESOR form = new PROFESOR();
                form.CI = conec.ci(txtusuario.Text, txtcontraseña.Text);
                form.Show();
                this.Close();
            }
            else if (rango == "Director" || rango == "Secretaria")
            {
                DIRECTOR form = new DIRECTOR();
                form.CI = conec.ci(txtusuario.Text, txtcontraseña.Text);
                form.Show();
                this.Close();
            }
            else
            {
                Lusuario.Visible = true;
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            DIRECTOR dIRECTOR = db.DIRECTOR.Find(id);

            db.DIRECTOR.Remove(dIRECTOR);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "DIR_ID,DIR_NOMBRE")] DIRECTOR dIRECTOR)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dIRECTOR).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dIRECTOR));
 }
        public ActionResult Create([Bind(Include = "DIR_ID,DIR_NOMBRE")] DIRECTOR dIRECTOR)
        {
            if (ModelState.IsValid)
            {
                db.DIRECTOR.Add(dIRECTOR);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(dIRECTOR));
        }
        // GET: DIRECTORs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DIRECTOR dIRECTOR = db.DIRECTOR.Find(id);

            if (dIRECTOR == null)
            {
                return(HttpNotFound());
            }
            return(View(dIRECTOR));
        }