public ActionResult Restore(string id) { backup_restorerepository.Restore(id); LogResposibility.Log(User, "Vừa restore vào lúc" + DateTime.Now); return(RedirectToAction("", "Home")); }
public ActionResult AddBakery(AddBakeryViewModel bakery) { // var path = Path.Combine(Server.MapPath("~/HinhAnh"), imageselected.FileName); ImageModel newimage = db.images.SingleOrDefault(p => p.Id == bakery.nameimage); // imageselected.SaveAs(path); Category category = db.Categorys.SingleOrDefault(p => p.Id == bakery.category_id); Bakery newbakery = new Bakery { ID = Guid.NewGuid().ToString(), ngaypost = DateTime.Now, Name = bakery.Bakeryname, category = category, Price = bakery.Price, images = newimage, count = bakery.quantity }; LogResposibility.Log(User, "Thêm bánh" + newbakery.Name); db.Bakerys.Add(newbakery); db.SaveChanges(); return(RedirectToAction("Index")); //return View(bakery); }
public ActionResult Backup() { backup_restorerepository.Backup(DateTime.Now); LogUser log = new LogUser(); var user = UserReposibility.getcurrentUser(User); LogResposibility.Log(User, "Vừa backup vào lúc" + DateTime.Now); return(RedirectToAction("Index")); }