Exemple #1
0
        private void insertHolyday(DateTime d , string holidayName)
        {
            clsHITM_CALENDAR_TB clstb = new clsHITM_CALENDAR_TB();

            clstb.HOLIDAY_DT = d.ToString("yyyyMMdd");
            clstb.HOLIDAY_NM = holidayName;
            clstb.COUNTRY = "SOUTH_KOREA";
            clstb.START_DT = "20000101";
            clstb.END_DT = "20400101";

            clstb.Insert();
        }
Exemple #2
0
        // static method

        public static bool isHoliday(string country, string dateStr)
        {
            System.Globalization.CultureInfo us 
                = new System.Globalization.CultureInfo("en-US");

            DateTime date = DateTime.ParseExact(dateStr, "yyyyMMdd", us);

            if (date.DayOfWeek == DayOfWeek.Saturday ||
                date.DayOfWeek == DayOfWeek.Sunday)
            {
                return true;
            }

            clsHITM_CALENDAR_TB clstb = new clsHITM_CALENDAR_TB();

            clstb.COUNTRY = country;
            clstb.HOLIDAY_DT = dateStr;

            int count = clstb.Select().Rows.Count;

            return (count > 0) ? true : false;
        }
Exemple #3
0
		public clsHITM_CALENDAR_TB Clone()
		{
			try
			{
				clsHITM_CALENDAR_TB cloneTB = new clsHITM_CALENDAR_TB();
				
				
				cloneTB._COUNTRY = this._COUNTRY;
				cloneTB._HOLIDAY_DT = this._HOLIDAY_DT;
				cloneTB._HOLIDAY_NM = this._HOLIDAY_NM;
				cloneTB._START_DT = this._START_DT;
				cloneTB._END_DT = this._END_DT; 
				
				return cloneTB;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}
Exemple #4
0
		public static clsHITM_CALENDAR_TB Create(DataRow dr)
		{
			try
			{
				clsHITM_CALENDAR_TB tb = new clsHITM_CALENDAR_TB();
				
				
				tb._COUNTRY = Convert.ToString(dr[0]);
				tb._HOLIDAY_DT = Convert.ToString(dr[1]);
				tb._HOLIDAY_NM = Convert.ToString(dr[2]);
				tb._START_DT = Convert.ToString(dr[3]);
				tb._END_DT = Convert.ToString(dr[4]); 
				
				return tb;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}