示例#1
0
        //=====================================================================

        /// <summary>
        /// Add a new holiday to the list box
        /// </summary>
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            using(HolidayPropertiesDlg dlg = new HolidayPropertiesDlg())
            {
                if(dlg.ShowDialog() == DialogResult.OK)
                {
                    holidays.Add(dlg.HolidayInfo);
                    this.LoadHolidayList();
                }
            }
        }
示例#2
0
    public HolidayCollection FillHolidayByID(Int32 LeaveID)
    {
        HolidayCollection vc = new HolidayCollection();

        NewDAL.DBManager objDB = new DBManager();
        objDB.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["FeesManagementConn"].ConnectionString;
        objDB.DBManager(DataAccessLayer.DataProvider.SqlServer, objDB.ConnectionString);
        objDB.Open();
        objDB.CreateParameters(1);
        objDB.AddParameters(0, "InstituteID", 0, DbType.Int32);
        objDB.AddParameters(1, "SessionID", "", DbType.String);
        objDB.AddParameters(2, "LeaveID", LeaveID, DbType.Int32);
        IDataReader dr = (IDataReader)objDB.ExecuteReader(CommandType.StoredProcedure, "GetVenueForTTable");

        while (dr.Read())
        {
            TimeTableDM.HolidayDM objDM = new TimeTableDM.HolidayDM();
            objDM.LeaveID   = Education.DataHelper.GetInt(dr, "LeaveID");
            objDM.LeaveName = Education.DataHelper.GetString(dr, "LeaveName");
            objDM.Type      = Education.DataHelper.GetString(dr, "Type");
            objDM.Date      = Education.DataHelper.GetDateTime(dr, "Date");
            vc.Add(objDM);
        }
        objDB.Connection.Close();
        objDB.Dispose();
        return(vc);
    }
 public void CanAddMultipleDatetime()
 {
     HolidayCollection.Clear();
     HolidayCollection.Add(new List <DateTime>()
     {
         DateTime.Now, DateTime.Now
     });
     Assert.AreEqual(HolidayCollection.Count(), 2);
 }
        public void GetAllHolidays()
        {
            HolidayCollection.Clear();
            HolidayCollection.Add(new List <DateTime>()
            {
                DateTime.Now, DateTime.Now
            });

            var holidayList = HolidayCollection.GetAll();

            Assert.AreEqual(HolidayCollection.Count(), holidayList.Count());
        }
 public void CanAddNewDatetime()
 {
     HolidayCollection.Clear();
     HolidayCollection.Add(DateTime.Now);
     Assert.Greater(HolidayCollection.Count(), 0);
 }
示例#6
0
 public void AddDaysWithHolidays()
 {
     HolidayCollection.Add(new DateTime(2015, 7, 23));
     Assert.AreEqual(new DateTime(2015, 7, 24), date.AddWorkableDays(3));
     HolidayCollection.Clear();
 }