Exemplo n.º 1
0
        public ActionResult Create(Tbl_Member tbl_Member, HttpPostedFileBase Photo, AspNetRole role, AspNetUser aspNetUser)
        {
            if (ModelState.IsValid)
            {
                /// Phone No

                if (Photo.ContentLength > 0)
                {
                    string _FileName = Path.GetFileName(Photo.FileName);
                    string _path     = Path.Combine(Server.MapPath("~/Content/Image"), _FileName);
                    tbl_Member.ImageURL = _FileName;
                    Photo.SaveAs(_path);
                }

                db.Tbl_Member.Add(tbl_Member);
                db.SaveChanges();
                FormsAuthentication.SignOut();
                Session.Abandon();
                return(RedirectToAction("Index"));
            }

            //var result = (from a in tbl_Member//.schemeid
            //              join b in Scheme on  //.schemeid on
            //              a.schemeid equals b.)

            ViewBag.Member = new SelectList(db.Tbl_Member, "SchemeId", "SchemeName");
            //ViewBag.Member = new SelectList(db.role, "Id", "Name");



            return(View(tbl_Member));
        }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Include = "SchemeId,SchemeName")] Scheme scheme)
        {
            if (ModelState.IsValid)
            {
                db.Schemes.Add(scheme);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(scheme));
        }