public IHttpActionResult PutportInfoChange(tPortfolio data) { data.DateUpdated = DateTime.Now; db.Entry(data).State = EntityState.Modified; db.SaveChanges(); return(Json(data)); }
public IHttpActionResult PostsavePortfolio(portFolioData value) { var obj = new tPortfolio(); byte[] imageBytes = Convert.FromBase64String(value.FileImg2); obj.Description = value.datacert2.Description; obj.URL = value.datacert2.URL; obj.Title = value.datacert2.Title; obj.ProjectImg = imageBytes; obj.PersonId = value.globalID; obj.DateCreated = DateTime.Now; obj.PersonId = value.globalID; obj.Status = 0; db.Entry(obj).State = EntityState.Added; db.SaveChanges(); var data = db.tPortfolios.OrderByDescending(a => a.recNo).FirstOrDefault(); return(Json(data)); }