Ejemplo n.º 1
0
        public ActionResult Create(Mobile mobile)
        {
            MobileRespository mobiles = new MobileRespository();

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

            UpdateModel <Mobile>(mobile);
            MobileRespository.Add(mobile);
            TempData["Message"] = "Added";
            return(RedirectToAction("MobileDetails"));
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 4
0
 public int Add(Mobile mobile)
 {
     return(mobileRespository.Add(mobile));
 }