Пример #1
0
 public ActionResult Edit([Bind(Include = "SchemeId,SchemeName")] Scheme scheme)
 {
     if (ModelState.IsValid)
     {
         db.Entry(scheme).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(scheme));
 }
Пример #2
0
        public ActionResult Edit([Bind(Include = "MemberId,MemberName,Mobile,Email,ImageURL,DateOfBirth,SchemeId,Addess,Sex,Weight,Height,BloodGroup,MemberType,PaymentDetail")] Tbl_Member tbl_Member)
        {
            List <SelectListItem> sex_items = new List <SelectListItem>();

            sex_items.Add(new SelectListItem()
            {
                Text = "FEMALE", Value = "FEMALE"
            });
            sex_items.Add(new SelectListItem()
            {
                Text = "MALE", Value = "MALE"
            });

            ViewBag.Sex    = sex_items;
            ViewBag.Member = new SelectList(db.Tbl_Member, "SchemeId", "SchemeName");
            if (ModelState.IsValid)
            {
                db.Entry(tbl_Member).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            return(View(tbl_Member));
        }