public IActionResult EditSesion(String option, int idSesion, int?idPartner, int?idWork, String name, String description, DateTime?date, int?comision, int?idImage) { if (option == "ADD") { this.repoSesion.AddPartnerWorkIntoSesion(idSesion, idPartner.Value, idWork.Value); } else if (option == "MODIFY") { String sessionName = this.repoSesion.GetSESIONID(idSesion).Name; String path = prov.MapPath(Folders.Session); ToolImage.RenameFolder(path, sessionName, name); this.repoSesion.ModifySesion(idSesion, name, description, date.Value, comision.Value); } else if (option == "SETIMAGE") { this.repoSesion.SetImageSession(idSesion, idImage.Value); } SESSION_COMPLEX sesion = this.repoSesion.GetSessionComplexById(idSesion); ViewBag.Date = sesion.DateSesion.ToString("yyyy-MM-dd"); ViewBag.Comision = this.repoComision.GetCOMISIONS().ToList(); ViewBag.Partner = this.repoPartner.GetPartners().ToList(); ViewBag.Work = this.repoWork.GetWORKs().ToList(); ViewBag.Workers = this.repoSesion.GetPartnerWorkBySesion(idSesion); ViewBag.Photos = this.repoPhoto.GetPhotos(idSesion).ToList(); return(View(sesion)); }
public IActionResult EditSesion(int id) { SESSION_COMPLEX sesion = this.repoSesion.GetSessionComplexById(id); ViewBag.Date = sesion.DateSesion.ToString("yyyy-MM-dd"); ViewBag.Comision = this.repoComision.GetCOMISIONS().ToList(); ViewBag.Partner = this.repoPartner.GetPartners().ToList(); ViewBag.Work = this.repoWork.GetWORKs().ToList(); ViewBag.Workers = this.repoSesion.GetPartnerWorkBySesion(id); ViewBag.Photos = this.repoPhoto.GetPhotos(id).ToList(); return(View(sesion)); }