Exemplo n.º 1
0
        public ActionResult addNewCaterer(caterer u)
        {
            HttpPostedFileBase file = Request.Files[0];

            if (file != null && file.ContentLength > 0)
            {
                file.SaveAs(Server.MapPath(@"~/img/" + file.FileName));
            }
            u.image = "../../img/" + file.FileName;
            if (u.image == "../../img/")
            {
                //Image File uploading is compulsory.
                u.image = "../../img/7.jpg";
            }

            int i = int.Parse(Session["uId"].ToString());

            o.add(u, i);
            return(RedirectToAction("ViewCaterer", "Caterer"));
        }
Exemplo n.º 2
0
        public ActionResult update(caterer c)
        {
            Database1Entities4 d = new Database1Entities4();
            int     id           = int.Parse(Session["cId"].ToString());
            caterer y            = d.caterers.First(x => x.Id == id);

            y.name        = c.name;
            y.address     = c.address;
            y.city        = c.city;
            y.description = c.description;
            y.email       = c.email;
            y.fb          = c.fb;
            y.note        = c.note;
            y.perhead     = c.perhead;
            y.phone       = c.phone;
            y.services    = c.services;
            y.social      = c.social;
            y.twitter     = c.twitter;
            d.SaveChanges();
            return(RedirectToAction("Index", "Home"));
        }
Exemplo n.º 3
0
 public ActionResult findCaterer(caterer c)
 {
     return(View(o.find(c)));
 }