Ejemplo n.º 1
0
        public static void AddNotWorkingDay(DateTime dt)
        {
            try
            {
                InitConnection();

                notworkingdaysTableAdapter adapter = new notworkingdaysTableAdapter();
                if (adapter.Connection != null)
                    adapter.Connection.Close();

                adapter.Connection = sqlCon;
                adapter.Insert(dt);
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
            }
        }
Ejemplo n.º 2
0
        public static bool IsNotWorkingDay(DateTime dt)
        {
            try
            {
                InitConnection();

                notworkingdaysTableAdapter adapter = new notworkingdaysTableAdapter();
                if (adapter.Connection != null)
                    adapter.Connection.Close();

                adapter.Connection = sqlCon;
                int res = Convert.ToInt32(adapter.sp_IsNotWorkngDay(dt));
                if (res == 1)
                    return true;
                else
                    return false;
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                return false;
            }
        }
Ejemplo n.º 3
0
        public static void DeleteNotWorkingDays(int year)
        {
            try
            {
                InitConnection();

                notworkingdaysTableAdapter adapter = new notworkingdaysTableAdapter();
                if (adapter.Connection != null)
                    adapter.Connection.Close();

                adapter.Connection = sqlCon;
                adapter.sp_DeleteNotWorkingDays(year);
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
            }
        }