private bool CheckIsServiceSessionTimeNoOverLap(int nEmployeeID, DateTime dtDateToBook, DateTime dtStartTimeToBook, DateTime dtEndTimeToBook, string strBranchCode) { TblRoster roster = new TblRoster(); string cmdText = " Select Count(*) from tblServiceSession Where nServiceEmployeeID = @nEmployeeID and (nStatusID <> 7 AND nStatusID <> 6 AND nStatusID <> 1) " + " and dtDate = @dtDate and " + " ((@dtStartTimeToBook Between dtStartTime AND dtEndTime ) or (@dtEndTimeToBook Between dtStartTime AND dtEndTime))"; object obj = roster.ExecuteScalar(cmdText, new string[] {"@nEmployeeID", "@dtDate", "@dtStartTimeToBook", "@dtEndTimeToBook"}, new object[] {nEmployeeID, dtDateToBook, dtStartTimeToBook, dtEndTimeToBook}); if (obj != null) { Int32 r = (Int32) obj; if (r > 0) throw new Exception(" The Time period you choose is been used by others. Please choose other time period."); else return true; } else return true; }
private void Init() { myRoster = new TblRoster(); //myDataTable = myCategory.SelectAll(); }
private void UpdateTimeSheetRecord(DataRow CurrRosterRow) { TblRoster myRoster = new TblRoster(); myRoster.NRosterID = ACMS.Convert.ToInt32(CurrRosterRow["nRosterID"]); myRoster.StrRemarks = CurrRosterRow["strRemarks"].ToString(); myRoster.Update2(); }