Beispiel #1
0
        public ActionResult Create(Mobile mobile)
        {
            MobileRespository mobiles = new MobileRespository();

            ViewBag.Mobile = new SelectList(mobiles.Brand(), "BrandId", "BrandName");
            mobiles.Add(mobile);
            return(RedirectToAction(""));
        }
        public ActionResult Create_post()
        {
            Mobile mobile = new Mobile();

            UpdateModel <Mobile>(mobile);
            MobileRespository.Add(mobile);
            TempData["Message"] = "Added";
            return(RedirectToAction("MobileDetails"));
        }
Beispiel #3
0
        public ActionResult Create_post(Mobile mobile)
        {
            Mobile mobiles = new Mobile();

            if (ModelState.IsValid)
            {
                mobile.Brand   = mobile.Brand;
                mobile.Model   = mobile.Model;
                mobile.Battery = mobile.Battery;
                mobile.RAM     = mobile.RAM;
                mobile.ROM     = mobile.ROM;
                mobile.Price   = mobile.Price;
                if (MobileRespository.Add(mobile) > 0)
                {
                    ViewBag.message = "Successfull";
                }
                ViewBag.message = "falied";
            }
            return(View());
        }
Beispiel #4
0
 public int Add(Mobile mobile)
 {
     return(mobileRespository.Add(mobile));
 }