public ActionResult Edit(EditAngatViewModel a) { var ang = a.angajat; ang.Firma = (int)Session["Id"]; if (ModelState.IsValid) { _showAngajati.Update(ang); TempData["check"] = "Angajatul a fost editat cu succes"; return(RedirectToAction("ShowAngajati", "OperationAngajat", new { id = Session["Id"] })); } a.Init(_functie, _angajatRepository, _utilajRepository, (int)Session["Id"]); return(View()); }
/* De Rezolvat maine */ public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var finde = _showAngajati.Get((int)id); if (finde == null) { return(HttpNotFound()); } var ang = new EditAngatViewModel() { angajat = finde }; ang.Init(_functie, _angajatRepository, _utilajRepository, (int)Session["Id"]); return(View(ang)); }