public ActionResult Edit([Bind(Include = "Id,Tittle,Version,Published,content,RowVersion")] ViewFileReleases vfileReleases) { if (ModelState.IsValid) { FileReleases fileReleases = vfileReleases.ExportTomodel(); this.relmngr.Edit(fileReleases); return(RedirectToAction("Index")); } ViewBag.Id = new SelectList(db.ChangeLogs, "Id", "Title", vfileReleases.Id); return(View(vfileReleases)); }
public ActionResult Create([Bind(Include = "Id,Tittle,Version,Published,content")] ViewFileReleases vfileReleases, int projectid) { vfileReleases.Project = Statics.mngr.GetProjectById(projectid); vfileReleases.Published = DateTime.Now; vfileReleases.UploadedBy = Statics.usrmng.GetUser(this.User.Identity.Name); //if (ModelState.IsValid) { FileReleases fileReleases = vfileReleases.ExportTomodel(); this.relmngr.CreateNew(fileReleases); return(RedirectToAction("Index")); } ViewBag.Id = new SelectList(db.ChangeLogs, "Id", "Title", vfileReleases.Id); return(View(vfileReleases)); }