//public TblLecturetime getTimeTable(int givenID) //{ // TblLecturetime tdObj = (TblLecturetime)NHSession.CreateCriteria(typeof(TblLecturetime)) // .Add(Restrictions.Eq(Constants.allModelProperties.LecturetimeId, givenID)) // .UniqueResult(); // return tdObj; //} //public bool deleteTimeTable(TblLecturetime L) //{ // bool result = false; // using (ITransaction T = NHSession.BeginTransaction()) // { // try // { // NHSession.Delete(L); // T.Commit(); // result = true; // } // catch (Exception ex) // { // T.Rollback(); // } // } // return result; //} public TblMorningtime getMorningSchedule(int givenID) { TblMorningtime tdObj = (TblMorningtime)NHSession.CreateCriteria(typeof(TblMorningtime)) .Add(Restrictions.Eq(Constants.allModelProperties.MorningtimeId, givenID)) .UniqueResult(); return(tdObj); }
public bool deleteMorningSchedule(TblMorningtime mt) { bool result = false; using (ITransaction T = NHSession.BeginTransaction()) { try { NHSession.Delete(mt); T.Commit(); result = true; } catch (Exception ex) { T.Rollback(); } } return(result); }
public bool AddTimeTableMorning(TblMorningtime Tbm) { bool result = false; using (ITransaction T = NHSession.BeginTransaction()) { try { NHSession.SaveOrUpdate(Tbm); T.Commit(); result = true; } catch (Exception ex) { T.Rollback(); } } return(result); }