public ActionResult Edit(int id) { if (User.IsInRole("administrator")) { KupacViewModel viewModel = new KupacViewModel { Kupac = repo.GetKupac(id), GetGrads = repo.GetGrads() }; return(View(viewModel)); } return(Redirect("/KupciPublic/Index")); }
public ActionResult Save(KupacViewModel viewModel) { if (!ModelState.IsValid) { return(Redirect("Index")); } var kupacDB = repo.GetKupac(viewModel.Kupac.IDKupac); kupacDB.Ime = viewModel.Kupac.Ime; kupacDB.Prezime = viewModel.Kupac.Prezime; kupacDB.Email = viewModel.Kupac.Email; kupacDB.Telefon = viewModel.Kupac.Telefon; kupacDB.GradID = viewModel.Kupac.GradID; repo.save(); return(Redirect("Index")); }
public UrediProfilPage(KupacViewModel kupacModel) { BindingContext = model = new KupacViewModel(); InitializeComponent(); }
public KupacPage() { InitializeComponent(); BindingContext = model = new KupacViewModel(); }