public void Update(ClassStudentMapEntity entity) { entity.UpdateTime = DateTime.Now; IDbSession session = SessionFactory.CreateSession(); try { session.BeginTrans(); Repository.Update <ClassStudentMapEntity>(session.Connection, entity, session.Transaction); session.Commit(); } catch (System.Exception) { session.Rollback(); throw; } finally { session.Dispose(); } }
public string PutClassStudentMap(ClassStudentMapEntity entity) { try { if (entity == null) { return("error"); } ClassStudentMapManager manager = new ClassStudentMapManager(); entity.CreateTime = DateTime.Now; entity.CreateTime = DateTime.Now; manager.Update(entity); return("success"); } catch (Exception e) { return(e.ToString()); } }
public string DeleteClassStudentMap(int id) { try { ClassStudentMapManager manager = new ClassStudentMapManager(); ClassStudentMapEntity entity = manager.GetClassStudentMapByID(id); if (entity != null) { entity.Valid = "F"; entity.CreateTime = DateTime.Now; entity.CreateTime = DateTime.Now; manager.Update(entity); } return("success"); } catch (Exception e) { return(e.ToString()); } }