Esempio n. 1
0
        public void AddUnit(HostingUnit hostingUnit)
        {
            hostingUnit.BookedDays = new List <DateTime>();
            hostingUnit.Diary      = new bool[12, 31];
            for (int i = 0; i < 12; i++)
            {
                for (int j = 0; j < 31; j++)
                {
                    hostingUnit.Diary[i, j] = false;
                }
            }

            if (hostingUnit.Area < 0 || hostingUnit.Area > (Areas)4)
            {
                throw new InvalidEnumArgumentException("Please insert correct area");
            }
            try
            {
                dal.AddUnit(hostingUnit);
            }
            catch (DuplicateWaitObjectException exc)
            {
                throw exc;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }