public ActionResult DeleteConfirmed(int id)
        {
            Birthmonth birthmonth = db.Birthmonths.Find(id);

            db.Birthmonths.Remove(birthmonth);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "BirthMonthID,BirthMonth1")] Birthmonth birthmonth)
 {
     if (ModelState.IsValid)
     {
         db.Entry(birthmonth).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(birthmonth));
 }
        public ActionResult Create([Bind(Include = "BirthMonthID,BirthMonth1")] Birthmonth birthmonth)
        {
            if (ModelState.IsValid)
            {
                db.Birthmonths.Add(birthmonth);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

            if (birthmonth == null)
            {
                return(HttpNotFound());
            }
            return(View(birthmonth));
        }
示例#5
0
 public Person(string firstname, string lastname, string email, int age, Gender gender, Birthmonth birth, string department, int telnumber)
 {
     this.Firstname  = firstname;
     this.Lastname   = lastname;
     this.Age        = age;
     this.Gender     = gender;
     this.Email      = email;
     this.Department = department;
     this.Telnumber  = telnumber;
 }