public IHttpActionResult PutSubject(long id, Subject subject) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != subject.PKSubjectId) { return(BadRequest()); } db.Entry(subject).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!SubjectExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutUserVideo(long id, UserVideo userVideo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != userVideo.PKUserVideoId) { return(BadRequest()); } db.Entry(userVideo).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UserVideoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutTeacherProfile(long id, TeacherProfile teacherProfile) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != teacherProfile.PKTeachersId) { return(BadRequest()); } db.Entry(teacherProfile).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TeacherProfileExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutAvailableTeacherTime(long id, AvailableTeacherTime availableTeacherTime) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != availableTeacherTime.PKAvailableTeacherTimeId) { return(BadRequest()); } db.Entry(availableTeacherTime).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!AvailableTeacherTimeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutClass(long id, Class @class) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != @class.PKClassId) { return(BadRequest()); } db.Entry(@class).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ClassExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public static void UpdateUserEnquiry(UserEnquiry objUserEnquiry) { TeachersEntities db = new TeachersEntities(); db.Entry(objUserEnquiry).State = EntityState.Modified; db.SaveChanges(); }
public static void UpdateLoginHistory(LoginHistory objLoginHistory) { TeachersEntities db = new TeachersEntities(); db.Entry(objLoginHistory).State = EntityState.Modified; db.SaveChanges(); }
public static void UpdateUserVideo(UserVideo userVideo) { TeachersEntities db = new TeachersEntities(); db.Entry(userVideo).State = EntityState.Modified; db.SaveChanges(); }
public static void UpdateCity(City objCity) { using (TeachersEntities db = new TeachersEntities()) { db.Entry(objCity).State = EntityState.Modified; db.SaveChanges(); } }
public static void UpdateUsers(UserProfile objuser) { TeachersEntities db = new TeachersEntities(); db.Entry(objuser).State = EntityState.Modified; db.SaveChanges(); cache.Remove("UserProfile"); }
public static void UpdateState(State objState) { using (TeachersEntities db = new TeachersEntities()) { db.Entry(objState).State = EntityState.Modified; db.SaveChanges(); cache.Remove("GetStates"); } }
public static void UpdateSubject(Subject objSubject) { using (TeachersEntities db = new TeachersEntities()) { db.Entry(objSubject).State = EntityState.Modified; db.SaveChanges(); } cache.Remove("GetSubjects"); }
public static void UpdateTeacherProfile(TeacherProfile objTeacher) { TeachersEntities db = new TeachersEntities(); try { db.Entry(objTeacher).State = EntityState.Modified; db.SaveChanges(); cache.Remove("GetTeachersHome"); } catch (Exception) { TeacherProfile oldEntry = db.TeacherProfiles.Find(objTeacher.PKTeachersId); db.Entry(oldEntry).CurrentValues.SetValues(objTeacher); db.SaveChanges(); cache.Remove("GetTeachersHome"); } }
public static void UpdateAvailableTeacherTime(AvailableTeacherTime objAvailableTeacherTime) { TeachersEntities db = new TeachersEntities(); db.Entry(objAvailableTeacherTime).State = EntityState.Modified; db.SaveChanges(); //db.AvailableTeacherTimes.Add(objAvailableTeacherTime); //db.SaveChanges(); cache.Remove("GetTeachersHome"); }