Exemple #1
0
        public void CreateMeeting(AppointmentModel data)
        {
            try
            {
                ExchangeService service        = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
                SearchFilter    sfSearchFilter = new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false);
                service.UseDefaultCredentials = true;

                service.AutodiscoverUrl(Session.UserData.email, adAutoDiscoCallBack);
                Appointment meeting = new Appointment(service);

                meeting.Subject = data.Subject;
                meeting.Body    = new EmailTemplate().MeetingMeghivo(data.interview.projekt_megnevezes, data.interview.date_start + "  " + data.interview.time_start + " - " + data.interview.time_end, data.interview.helyszin, data.interview.jelolt_megnevezes);
                DateTime date_start = DateHandler.GenerateFromString(data.Start, data.Time_start);
                DateTime date_end   = DateHandler.GenerateFromString(data.Start, data.Time_end);
                meeting.Start    = date_start;
                meeting.End      = date_end;
                meeting.Location = data.Location;
                foreach (var attendee in data.Attendees)
                {
                    meeting.RequiredAttendees.Add(attendee);
                }
                meeting.ReminderMinutesBeforeStart = 30;
                meeting.Save(SendInvitationsMode.SendToAllAndSaveCopy);
                Item item = Item.Bind(service, meeting.Id, new PropertySet(ItemSchema.Subject));
            }
            catch (Exception e)
            {
                MessageBox.Show("Sikertelen létrehozás! \n\n Error: \n" + e);
            }
        }
    protected void LoadLinkSuggestionList()
    {
        DateTime   fromDate;
        DateTime   untilDate;
        List <int> linkSuggestionRefList = GetPostCollection("SuggestionCheckBox");

        try
        {
            fromDate  = DateHandler.ParseDateString(FromDateTextBox.Text);
            untilDate = DateHandler.ParseDateString(UntilDateTextBox.Text);
        }
        catch { return; }
        using (var db = CLinq.DataContext.Create())
        {
            var linkSuggestionQuery =
                from ls in db.LinkSuggestions
                where ls.LinkSuggestionDate.Date <= untilDate && ls.LinkSuggestionDate.Date >= fromDate
                select new
            {
                ls.LinkSuggestionRef,
                ls.LinkUrl,
                ls.Description,
                ls.Category.CategoryName,
                ls.User.UserName,
                ls.LinkSuggestionDate,
                IsChecked = linkSuggestionRefList.Contains(ls.LinkSuggestionRef)
            };

            LinkSuggestionList.DataSource = linkSuggestionQuery.ToList();;
            LinkSuggestionList.DataBind();
        }
    }
Exemple #3
0
        public IEnumerable <RecordAverageDTO> FilterByDate([FromRoute] int userId, double fromDate, double toDate)
        {
            DateHandler dateHandler = new DateHandler();

            string dateFrom = dateHandler.ConvertToSqlStringDate(fromDate);
            string dateTo   = dateHandler.ConvertToSqlStringDate(toDate);


            string _selectString = "SELECT Datepart(\"Day\", \"RecordTime\") as \"DayDate\", Datepart(\"Month\", \"RecordTime\") as \"MonthDate\", avg(\"BPSystolic\") as \"BpSystolicAvg\", avg(\"BPDiastolic\") as \"BpDiastolicAvg\", avg(\"BodyTemperature\") as \"BodyTemperature\", avg(\"HeartBeatPerSecond\") as \"HeartBeatPerSecond\", avg(\"Dust\") as \"Dust\", avg(\"Sulphur\") as \"Sulphur\", avg(\"Nitrogen\") as \"Nitrogen\", avg(\"Fluor\") as \"Fluor\", avg(\"CarbonMonoxide\") as \"CarbonMonoxide\", avg(\"Ozone\") as \"Ozone\", avg(\"RaspberryRecord\".\"Temperature\") as \"Temperature\", avg(\"RaspberryRecord\".\"Pressure\") as \"Pressure\", avg(\"RaspberryRecord\".\"Humudity\") as \"Humidity\" FROM \"Record\" INNER JOIN \"RaspberryRecord\" ON \"Record\".\"UserID\" = \"RaspberryRecord\".\"UserId\" WHERE \"Record\".\"UserID\" = " + userId + " AND \"RecordTime\" BETWEEN " + dateFrom + " AND " + dateTo + " AND \"DateTime\" BETWEEN " + dateFrom + " AND " + dateTo + " group by Datepart (\"Day\", \"RecordTime\"), Datepart (\"Month\", \"RecordTime\")";

            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();

                using (var cmd = new SqlCommand(_selectString, conn))
                {
                    using (var reader = cmd.ExecuteReader())
                    {
                        List <RecordAverageDTO> RecordList = new List <RecordAverageDTO>();

                        while (reader.Read())
                        {
                            DataReader       dataReader = new DataReader();
                            RecordAverageDTO mtc        = dataReader.ReadRecordAverageDTO(reader);
                            RecordList.Add(mtc);
                        }

                        //ObjectConverter objConverted = new ObjectConverter();
                        //JObject jObject = objConverted.dayJson(RecordList);
                        return(RecordList);
                    }
                }
            }
        }
        public static JsConfigScope With(
            bool? convertObjectTypesIntoStringDictionary = null,
            bool? tryToParsePrimitiveTypeValues = null,
			bool? tryToParseNumericType = null,
            bool? includeNullValues = null,
            bool? includeDefaultEnums = null,
            bool? excludeTypeInfo = null,
            bool? includeTypeInfo = null,
            bool? emitCamelCaseNames = null,
            bool? emitLowercaseUnderscoreNames = null,
            DateHandler? dateHandler = null,
            TimeSpanHandler? timeSpanHandler = null,
            PropertyConvention? propertyConvention = null,
            bool? preferInterfaces = null,
            bool? throwOnDeserializationError = null,
            string typeAttr = null,
            Func<Type, string> typeWriter = null,
            Func<string, Type> typeFinder = null,
			bool? treatEnumAsInteger = null,
            bool? alwaysUseUtc = null,
            bool? assumeUtc = null,
            bool? appendUtcOffset = null,
            bool? escapeUnicode = null,
            bool? includePublicFields = null,
            bool? reuseStringBuffer = null,
            int? maxDepth = null,
            EmptyCtorFactoryDelegate modelFactory = null,
            string[] excludePropertyReferences = null)
        {
            return new JsConfigScope {
                ConvertObjectTypesIntoStringDictionary = convertObjectTypesIntoStringDictionary ?? sConvertObjectTypesIntoStringDictionary,
                TryToParsePrimitiveTypeValues = tryToParsePrimitiveTypeValues ?? sTryToParsePrimitiveTypeValues,
                TryToParseNumericType = tryToParseNumericType ?? sTryToParseNumericType,
                IncludeNullValues = includeNullValues ?? sIncludeNullValues,
                IncludeDefaultEnums = includeDefaultEnums ?? sIncludeDefaultEnums,
                ExcludeTypeInfo = excludeTypeInfo ?? sExcludeTypeInfo,
                IncludeTypeInfo = includeTypeInfo ?? sIncludeTypeInfo,
                EmitCamelCaseNames = emitCamelCaseNames ?? sEmitCamelCaseNames,
                EmitLowercaseUnderscoreNames = emitLowercaseUnderscoreNames ?? sEmitLowercaseUnderscoreNames,
                DateHandler = dateHandler ?? sDateHandler,
                TimeSpanHandler = timeSpanHandler ?? sTimeSpanHandler,
                PropertyConvention = propertyConvention ?? sPropertyConvention,
                PreferInterfaces = preferInterfaces ?? sPreferInterfaces,
                ThrowOnDeserializationError = throwOnDeserializationError ?? sThrowOnDeserializationError,
                TypeAttr = typeAttr ?? sTypeAttr,
                TypeWriter = typeWriter ?? sTypeWriter,
                TypeFinder = typeFinder ?? sTypeFinder,
                TreatEnumAsInteger = treatEnumAsInteger ?? sTreatEnumAsInteger,
                AlwaysUseUtc = alwaysUseUtc ?? sAlwaysUseUtc,
                AssumeUtc = assumeUtc ?? sAssumeUtc,
                AppendUtcOffset = appendUtcOffset ?? sAppendUtcOffset,
                EscapeUnicode = escapeUnicode ?? sEscapeUnicode,
                IncludePublicFields = includePublicFields ?? sIncludePublicFields,
                ReuseStringBuffer = reuseStringBuffer ?? sReuseStringBuffer,
                MaxDepth = maxDepth ?? sMaxDepth,
                ModelFactory = modelFactory ?? ModelFactory,
                ExcludePropertyReferences = excludePropertyReferences ?? sExcludePropertyReferences
            };
        }
Exemple #5
0
        public void Add1000DaysTo20170101()
        {
            var      sut     = new DateHandler();
            var      theDate = new DateTime(2017, 1, 1);
            DateTime endDate = sut.Add1000Days(theDate);

            Assert.AreEqual(new DateTime(2019, 9, 28), endDate);
        }
Exemple #6
0
        public void DaysBetween20170101And20190320()
        {
            var sut        = new DateHandler();
            var firstDate  = new DateTime(2017, 1, 1);
            var secondDate = new DateTime(2019, 3, 20);
            int days       = sut.DaysBetweenDates(firstDate, secondDate);

            Assert.AreEqual(808, days);
        }
        protected object newTime(object o)
        {
            String      s    = (String)o;
            DateHandler dh   = new DateHandler();
            DateTime    time = dh.stringToDate(s);

            o = time.ToString("d MMM HH:mm");
            return(o);
        }
    private void CIRCUIT_Create()
    {
        DateHandler Circuit = new DateHandler("Alleghany", "Circuit");



        int[] weekAll = new int[] { 1 };
        int[] week1   = new int[] { 1 };
        int[] week2   = new int[] { 1 };
        int[] week3   = new int[] { 1 };
        int[] week4   = new int[] { 1 };
        int[] week5   = new int[] { 1 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "8:30";
        String Tue = "8:30";
        String Wed = "8:30";
        String Thu = "8:30";
        String Fri = "8:30";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("Return", weekTable, 21, 1000, DayOfWeekTime);

        String reminder = "If during business hours, call the clerk’s office and use the return date they give you.";

        Circuit.Reminder_Create(reminder, "Return");


        weekAll = new int[] { 0 };
        week1   = new int[] { 1, 2, 3, 4 };
        week2   = new int[] { 1, 2, 3, 4, 5 };
        week3   = new int[] { 1, 2, 3, 4, 5 };
        week4   = new int[] { 1, 2, 3, 4, 5 };
        week5   = new int[] { 1, 2, 3, 4, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "8:30";
        Tue = "8:30";
        Wed = "8:30";
        Thu = "8:30";
        Fri = "8:30";


        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” day is a Monday, Tuesday, or Thursday, set the “crossover” court as GDC.";
        Circuit.Reminder_Create(reminder, "CrossOver");

        reminder = "If the “whichever comes first” day is a Wednesday or Friday, set the “crossover” court as JDR.";
        Circuit.Reminder_Create(reminder, "CrossOver");
    }
    private void CIRCUIT_Create()
    {
        DateHandler Circuit = new DateHandler("Augusta", "Circuit");



        int[] weekAll = new int[] { 1, 2, 3, 4, 5 };
        int[] week1   = new int[] { 1, 2, 3, 4, 5 };
        int[] week2   = new int[] { 1, 2, 3, 4, 5 };
        int[] week3   = new int[] { 1, 2, 3, 4, 5 };
        int[] week4   = new int[] { 1, 2, 3, 4, 5 };
        int[] week5   = new int[] { 1, 2, 3, 4, 5 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "9:00";
        String Tue = "9:00";
        String Wed = "9:00";
        String Thu = "9:00";
        String Fri = "9:00";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("Return", weekTable, 1, 1000, DayOfWeekTime);

        String reminder = "If the next return date from the above list is less than two business days out from today’s date, you must fax a copy of the paperwork you issue to the Court.";

        Circuit.Reminder_Create(reminder, "Return");


        weekAll = new int[] { 1, 2, 3, 4, 5 };
        week1   = new int[] { 1, 2, 3, 4, 5 };
        week2   = new int[] { 1, 2, 3, 4, 5 };
        week3   = new int[] { 1, 2, 3, 4, 5 };
        week4   = new int[] { 1, 2, 3, 4, 5 };
        week5   = new int[] { 1, 2, 3, 4, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "8:30";
        Tue = "8:30";
        Wed = "8:30";
        Thu = "8:30";
        Fri = "8:30";


        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the next weekday day is a Tuesday, Thursday, or Friday set crossover court as GDC.";
        Circuit.Reminder_Create(reminder, "CrossOver");

        reminder = "If the next weekday is a Monday or Wednesday, set crossover court as JDR.";
        Circuit.Reminder_Create(reminder, "CrossOver");
    }
Exemple #10
0
        public void ReturnDateTimeFormat2()
        {
            var start       = "1 April";
            var end         = "30 April";
            var dateHandler = new DateHandler(start, end);
            var result      = dateHandler.ToString();
            var expected    = "01 April - 30 April";

            Assert.Equal(expected, result);
        }
Exemple #11
0
        public void ReturnDateTimeFormat()
        {
            var start       = "1 March";
            var end         = "31 March";
            var dateHandler = new DateHandler(start, end);
            var result      = dateHandler.ToString();
            var expected    = "01 March - 31 March";

            Assert.Equal(expected, result);
        }
Exemple #12
0
    private void CIRCUIT_Create()
    {
        DateHandler Circuit = new DateHandler("Craig", "Circuit");



        int[] weekAll = new int[] { 0 };
        int[] week1   = new int[] { 0 };
        int[] week2   = new int[] { 0 };
        int[] week3   = new int[] { 0 };
        int[] week4   = new int[] { 0 };
        int[] week5   = new int[] { 0 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "0:00";
        String Tue = "0:00";
        String Wed = "0:00";
        String Thu = "0:00";
        String Fri = "0:00";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("Return", weekTable, 1, 1000, DayOfWeekTime);

        String reminder = "If during business hours, call clerk’s office and use the return date they give you. If after hours, or you are unable to speak to anyone in the clerk’s office, call the Sheriff’s office for the next Circuit Court return date (not the deputy’s next court date).";

        Circuit.Reminder_Create(reminder, "Return");


        weekAll = new int[] { 0 };
        week1   = new int[] { 2, 5 };
        week2   = new int[] { 5 };
        week3   = new int[] { 2 };
        week4   = new int[] { 5 };
        week5   = new int[] { 4, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "8:30";
        Tue = "8:30";
        Wed = "8:30";
        Thu = "8:30";
        Fri = "8:30";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” date is a Tuesday or Thursday, set crossover court as GDC.";
        Circuit.Reminder_Create(reminder, "CrossOver");

        reminder = "If the “whichever comes first” date is a Friday, set crossover court as JDR.";
        Circuit.Reminder_Create(reminder, "CrossOver");
    }
    private void CIRCUIT_Create()
    {
        DateHandler Circuit = new DateHandler("LexingtonRockbridge", "Circuit");



        int[] weekAll = new int[] { 1, 2, 3, 4, 5 };
        int[] week1   = new int[] { 1, 2, 3, 4, 5 };
        int[] week2   = new int[] { 1, 2, 3, 4, 5 };
        int[] week3   = new int[] { 1, 2, 3, 4, 5 };
        int[] week4   = new int[] { 1, 2, 3, 4, 5 };
        int[] week5   = new int[] { 1, 2, 3, 4, 5 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "9:00";
        String Tue = "9:00";
        String Wed = "9:00";
        String Thu = "9:00";
        String Fri = "9:00";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("Return", weekTable, 1, 1000, DayOfWeekTime);

        String reminder = "If the next return date from the above list is less than two business days out from today’s date, you must fax a copy of the paperwork you issue to the Court.";

        Circuit.Reminder_Create(reminder, "Return");


        weekAll = new int[] { 0 };
        week1   = new int[] { 1, 3, 4 };
        week2   = new int[] { 1, 2, 3, 5 };
        week3   = new int[] { 1, 3, 4, 5 };
        week4   = new int[] { 1, 2, 3, 4, 5 };
        week5   = new int[] { 1, 3, 4, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon           = "9:00";
        Tue           = "9:00";
        Wed           = "9:00";
        Thu           = "9:00";
        Fri           = "9:00";
        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” date is a Monday; Wednesday; or a second, third, fourth, or fifth Friday, set crossover court as GDC.";
        Circuit.Reminder_Create(reminder, "CrossOver");

        reminder = "If the “whichever comes first” date is a second or fourth Tuesday or a first, third, fourth, or fifth Thursday, set crossover court as JDR.";
        Circuit.Reminder_Create(reminder, "CrossOver");
    }
Exemple #14
0
        private void Uj_interju_mentes_btn_Click(object sender, RoutedEventArgs e)
        {
            if (inter_helyszin.Text == "" || inter_idopont_hour.Text == "" || inter_idopont_hour_end.Text == "" || inter_date_year.Text == "" || inter_date_month.Text == "" || inter_date_day.Text == "")
            {
                InterviewInfo_tbx.Text = "Minden mező kitöltése kötelező";
                return;
            }
            if (Convert.ToUInt32(inter_date_year.Text) < 1900 ||
                Convert.ToUInt32(inter_date_year.Text) > 2100 ||
                Convert.ToUInt32(inter_date_day.Text) > 31 ||
                Convert.ToUInt32(inter_date_day.Text) < 1 ||
                Convert.ToUInt32(inter_date_month.Text) > 12 ||
                Convert.ToUInt32(inter_date_month.Text) < 1)
            {
                InterviewInfo_tbx.Text = "Dátum megadása hibás!";
                return;
            }
            int hour_start   = Convert.ToInt32(inter_idopont_hour.Text);
            int minute_start = (inter_idopont_minute.Text != "" ? Convert.ToInt32(inter_idopont_minute.Text) : 0);
            int hour_end     = Convert.ToInt32(inter_idopont_hour_end.Text);
            int minute_end   = (inter_idopont_minute_end.Text != "" ? Convert.ToInt32(inter_idopont_minute_end.Text) : 0);

            if (hour_start == 0 || hour_start > 24 || minute_start > 59 || hour_end == 0 || hour_end > 24 || minute_end > 59)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }
            if ((hour_start == hour_end && minute_end < minute_start) || hour_end < hour_start)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }

            string        datum   = inter_date_year.Text + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_month.Text).ToString()) + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_day.Text).ToString()) + ".";
            ModelUserData user    = UserData.GetById(projekt.hr_id);
            string        idopont = hour_start + ":" + (minute_start < 10 ? "0" + minute_start.ToString() : minute_start.ToString()) + " - " + hour_end + ":" + (minute_end < 10 ? "0" + minute_end.ToString() : minute_end.ToString());

            new Email().Send(user.email, new EmailTemplate().Meeting_igenyles(user.name, Session.UserData.name, inter_jelolt.Text, projekt.megnevezes_projekt, datum, idopont, inter_helyszin.Text, inter_leiras.Text));
            new ModelSzakmaiInterviewIgeny().Insert(new ModelSzakmaiInterviewIgeny {
                jelolt_id = Convert.ToInt32(inter_jelolt_id.Text), projekt_id = projekt.id, user_id = Session.UserData.id, state = 1
            });
            formLoader();
            Interview_Panel_Close();
        }
        private void RegisterBuiltinHandlers()
        {
            IntHandler intHandler = new IntHandler();

            RegisterBuiltinHandler(Handlers4.IntId, intHandler);
            RegisterHandlerVersion(intHandler, 0, new IntHandler0());
            LongHandler longHandler = new LongHandler();

            RegisterBuiltinHandler(Handlers4.LongId, longHandler);
            RegisterHandlerVersion(longHandler, 0, new LongHandler0());
            FloatHandler floatHandler = new FloatHandler();

            RegisterBuiltinHandler(Handlers4.FloatId, floatHandler);
            RegisterHandlerVersion(floatHandler, 0, new FloatHandler0());
            BooleanHandler booleanHandler = new BooleanHandler();

            RegisterBuiltinHandler(Handlers4.BooleanId, booleanHandler);
            // TODO: Are we missing a boolean handler version?
            DoubleHandler doubleHandler = new DoubleHandler();

            RegisterBuiltinHandler(Handlers4.DoubleId, doubleHandler);
            RegisterHandlerVersion(doubleHandler, 0, new DoubleHandler0());
            ByteHandler byteHandler = new ByteHandler();

            RegisterBuiltinHandler(Handlers4.ByteId, byteHandler);
            // TODO: Are we missing a byte handler version?
            CharHandler charHandler = new CharHandler();

            RegisterBuiltinHandler(Handlers4.CharId, charHandler);
            // TODO: Are we missing a char handler version?
            ShortHandler shortHandler = new ShortHandler();

            RegisterBuiltinHandler(Handlers4.ShortId, shortHandler);
            RegisterHandlerVersion(shortHandler, 0, new ShortHandler0());
            _stringHandler = new StringHandler();
            RegisterBuiltinHandler(Handlers4.StringId, _stringHandler);
            RegisterHandlerVersion(_stringHandler, 0, new StringHandler0());
            DateHandler dateHandler = new DateHandler();

            RegisterBuiltinHandler(Handlers4.DateId, dateHandler);
            RegisterHandlerVersion(dateHandler, 0, new DateHandler0());
            RegisterUntypedHandlers();
            RegisterCompositeHandlerVersions();
        }
Exemple #16
0
 public void updateDays()
 {
     listBoxDays.Items.Clear();
     var dateHandler = new DateHandler();
     
     var setDate = dateHandler.GetDays(dpStartDate.SelectedDate.Value, dpEndDate.SelectedDate.Value);
     //if (setDate.Count == 0)
     //{
     //    MessageBox.Show("Du kan inte resa mindre dagar än dagar du är ledig eller välja senare start- än slutdatum.");
     //}
     //else
     //{
     foreach (var item in setDate)
     {
         var hej = String.Format(item.Day.ToString() + "/" + item.Month.ToString() + "/" + item.Year.ToString());
         listBoxDays.Items.Add(hej);
     }
     //}
     }
Exemple #17
0
        // Displays all the orders based off of order date
        public OrdersDisplayResponse DisplayOrders(string orderDate)
        {
            OrdersDisplayResponse response = new OrdersDisplayResponse {
                Orders = _orderRepository.LoadOrders(orderDate)
            };

            // Checks the date is valid
            if (!DateHandler.IsValidDate(orderDate))
            {
                response.Success = false;
                response.Code    = ErrorCode.NotAValidDate;
                return(response);
            }

            // LoadOrders returns null if it can't find a file
            if (response.Orders == null)
            {
                response.Success = false;
                response.Code    = ErrorCode.CouldNotFindFile;
                return(response);
            }

            // LoadOrders returns an order with number -1 if the file it's reading from is corrupt
            if (response.Orders.Any(x => x.Number == -1))
            {
                response.Success = false;
                response.Code    = ErrorCode.CorruptFile;
                return(response);
            }

            // If no orders were added to the list, the file is empty
            if (response.Orders.Count() == 0)
            {
                response.Success = false;
                response.Code    = ErrorCode.FileIsEmpty;
                return(response);
            }

            response.Success = true;


            return(response);
        }
    protected override void OnPreRender(EventArgs e)
    {
        CuplexLib.User user = Session["User"] as CuplexLib.User;
        if (user == null || !user.IsAdmin)
        {
            return;
        }

        AdminPagePanel.Visible = true;
        registerScripts();
        if (!IsPostBack)
        {
            FromDateTextBox.Text  = DateHandler.ToDateString(DateTime.Today.AddDays(-3));
            UntilDateTextBox.Text = DateHandler.ToDateString(DateTime.Today);
            loadDataList();
        }

        base.OnPreRender(e);
    }
    internal NodaTimeTypeHandlerResolver(NpgsqlConnector connector)
    {
        _databaseInfo = connector.DatabaseInfo;

        _timestampHandler = LegacyTimestampBehavior
            ? new LegacyTimestampHandler(PgType("timestamp without time zone"))
            : new TimestampHandler(PgType("timestamp without time zone"));
        _timestampTzHandler = LegacyTimestampBehavior
            ? new LegacyTimestampTzHandler(PgType("timestamp with time zone"))
            : new TimestampTzHandler(PgType("timestamp with time zone"));
        _dateHandler     = new DateHandler(PgType("date"));
        _timeHandler     = new TimeHandler(PgType("time without time zone"));
        _timeTzHandler   = new TimeTzHandler(PgType("time with time zone"));
        _intervalHandler = new IntervalHandler(PgType("interval"));

        // Note that the range handlers are absent on some pseudo-PostgreSQL databases (e.g. CockroachDB), and multirange types
        // were only introduced in PG14. So we resolve these lazily.

        _arrayNullabilityMode = connector.Settings.ArrayNullabilityMode;
    }
Exemple #20
0
        protected void uj_interju_mentes_btn_Click(object sender, RoutedEventArgs e)
        {
            if (inter_helyszin.Text == "" || inter_idopont_hour.Text == "" || inter_idopont_hour_end.Text == "" || inter_date_year.Text == "" || inter_date_month.Text == "" || inter_date_day.Text == "")
            {
                InterviewInfo_tbx.Text = "Minden mező kitöltése kötelező";
                return;
            }
            if (Convert.ToUInt32(inter_date_year.Text) < 1900 ||
                Convert.ToUInt32(inter_date_year.Text) > 2100 ||
                Convert.ToUInt32(inter_date_day.Text) > 31 ||
                Convert.ToUInt32(inter_date_day.Text) < 1 ||
                Convert.ToUInt32(inter_date_month.Text) > 12 ||
                Convert.ToUInt32(inter_date_month.Text) < 1)
            {
                InterviewInfo_tbx.Text = "Dátum megadása hibás!";
                return;
            }
            int hour_start   = Convert.ToInt32(inter_idopont_hour.Text);
            int minute_start = (inter_idopont_minute.Text != "" ? Convert.ToInt32(inter_idopont_minute.Text) : 0);
            int hour_end     = Convert.ToInt32(inter_idopont_hour_end.Text);
            int minute_end   = (inter_idopont_minute_end.Text != "" ? Convert.ToInt32(inter_idopont_minute_end.Text) : 0);

            if (hour_start == 0 || hour_start > 24 || minute_start > 59 || hour_end == 0 || hour_end > 24 || minute_end > 59)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }
            if ((hour_start == hour_end && minute_end < minute_start) || hour_end < hour_start)
            {
                InterviewInfo_tbx.Text = "Időpont megadása hibás!";
                return;
            }

            string datum = inter_date_year.Text + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_month.Text).ToString()) + "." + DateHandler.NormalForm(Convert.ToUInt32(inter_date_day.Text).ToString()) + ".";

            new Interview().addInterview(datum, inter_cim.SelectedItem.ToString(), inter_leiras.Text, inter_helyszin.Text, hour_start + ":" + (minute_start < 10 ? "0" + minute_start.ToString() : minute_start.ToString()), hour_end + ":" + (minute_end < 10 ? "0" + minute_end.ToString() : minute_end.ToString()));
            projectFormLoader();
            interviewPanelClose();
        }
    private void LoadLinkList()
    {
        DateTime   fromDate;
        DateTime   untilDate;
        List <int> selectedLinkRefList = GetPostCollection("LinkSelectionCheckBox");

        try
        {
            fromDate  = DateHandler.ParseDateString(FromDateTextBox.Text);
            untilDate = DateHandler.ParseDateString(UntilDateTextBox.Text);
        }
        catch { return; }

        using (var db = CLinq.DataContext.Create())
        {
            var linkQuery =
                from li in db.Links
                where li.LinkDate.Date >= fromDate && li.LinkDate.Date <= untilDate
                orderby li.LinkDate descending
                select new
            {
                li.LinkRef,
                li.LinkName,
                li.LinkDate,
                li.CategoryRef,
                CategoryName = li.Category.CategoryName,
                UserName     = li.UserRef != null ? li.User.UserName : "",
                li.LinkUrl,
                li.Clicks,
                li.Rating,
                IsChecked = selectedLinkRefList.Contains(li.LinkRef)
            };

            LinkList.DataSource = linkQuery.ToList();
            LinkList.DataBind();
        }
    }
    protected void AddLinkButton_Clicked(object sender, EventArgs e)
    {
        CuplexLib.User user = Session["User"] as CuplexLib.User;
        LinkDateTextBox.Text = DateHandler.ToDateString(DateTime.Today);
        LinkTimeTextBox.Text = DateHandler.ToTimeString(DateTime.Now);
        LinkCategoryDropdownList.DataValueField = "CategoryRef";
        LinkCategoryDropdownList.DataTextField  = "CategoryName";
        LinkCategoryDropdownList.DataSource     = Category.GetCategoryList();
        LinkCategoryDropdownList.DataBind();

        LinkUserDropDownList.Items.Clear();
        LinkUserDropDownList.Items.Add(new ListItem("null", "0"));
        LinkUserDropDownList.Items.Add(new ListItem(user.UserName, user.UserRef.ToString()));
        LinkUserDropDownList.SelectedIndex = 1;

        LinkNameTextBox.Text   = "";
        LinkUrlTextBox.Text    = "";
        LinkClicksTextBox.Text = "0";
        LinkRatingTextBox.Text = "0";

        this.ViewState["EditLinkRef"] = 0;
        EditLinkPanel.Visible         = true;
        base.ShowModalBackground();
    }
Exemple #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable ships = DataBaseHandler.getActiveShips();

            messageIdGenerator = new MessageIdGenerator();
            shipList           = new List <Vessel>();
            dateHandler        = new DateHandler();
            foreach (DataRow ship in ships.Rows)
            {
                var v = new Vessel
                {
                    imo        = ship["imoNumber"].ToString(),
                    name       = ship["name"].ToString(),
                    photoURL   = ship["imgURL"].ToString(),
                    portCallId = ship["portCallID"].ToString()
                };
                shipList.Add(v);
            }

            if (!IsPostBack)
            {
                initPage();
            }
        }
    private void GDC_Create()
    {
        DateHandler gdc = new DateHandler("Highland", "General District");



        int[] weekAll = new int[] { 0 };
        int[] week1   = new int[] { 3 };
        int[] week2   = new int[] { 0 };
        int[] week3   = new int[] { 3 };
        int[] week4   = new int[] { 0 };
        int[] week5   = new int[] { 0 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "14:00";
        String Tue = "14:00";
        String Wed = "14:00";
        String Thu = "14:00";
        String Fri = "14:00";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("Return", weekTable, 1, 1000, DayOfWeekTime);

        String reminder = "If LEO obtains a Class 3 or 4 charge, use LEO’s next court date. If there are any additional charges arising out of the same Class 3 or 4 incident that are issued on a warrant, all the charges (including the Class 3 or 4) should be set for a regular return date.";

        gdc.Reminder_Create(reminder, "Return");


        weekAll = new int[] { 0 };
        week1   = new int[] { 2, 3 };
        week2   = new int[] { 0 };
        week3   = new int[] { 3 };
        week4   = new int[] { 0 };
        week5   = new int[] { 0 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "8:30";
        Tue = "8:30";
        Wed = "8:30";
        Thu = "8:30";
        Fri = "8:30";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” day is a Tuesday, set the “crossover” court as JDR (10:00 am).";
        gdc.Reminder_Create(reminder, "CrossOver");

        reminder = "If the “whichever comes first” day is a Wednesday, set the “crossover” court as GDC (2:00 pm).";
        gdc.Reminder_Create(reminder, "CrossOver");

        weekAll = new int[] { 0 }; //atleast 3 day's after today's date
        week1   = new int[] { 3 };
        week2   = new int[] { 0 };
        week3   = new int[] { 3 };
        week4   = new int[] { 0 };
        week5   = new int[] { 0 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "0:00";
        Tue = "0:00";
        Wed = "0:00";
        Thu = "0:00";
        Fri = "0:00";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("EPO", weekTable, 3, 1000, DayOfWeekTime);
    }
    private void CIRCUIT_Create()
    {
        DateHandler Circuit = new DateHandler("Highland", "Circuit");



        int[] weekAll = new int[] { 0 }; //Third Tuesday of March, June, September, or December.
        int[] week1   = new int[] { 0 };
        int[] week2   = new int[] { 0 };
        int[] week3   = new int[] { 0 };
        int[] week4   = new int[] { 0 };
        int[] week5   = new int[] { 0 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "9:30";
        String Tue = "9:30";
        String Wed = "9:30";
        String Thu = "9:30";
        String Fri = "9:30";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("Return", weekTable, 1, 1000, DayOfWeekTime);

        String reminder = "If the next return date from the above list is less than two business days out from today’s date, you must fax a copy of the paperwork you issue to the Court.";

        Circuit.Reminder_Create(reminder, "Return");

        reminder = "If during business hours, call the clerk’s office and use the return date they give you.";
        Circuit.Reminder_Create(reminder, "Return");

        weekAll = new int[] { 0 };
        week1   = new int[] { 0 };
        week2   = new int[] { 0 };
        week3   = new int[] { 2 };
        week4   = new int[] { 0 };
        week5   = new int[] { 0 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };
        int [] monthList = new[] { 3, 6, 9, 12 };
        Circuit.MonthException_Create("Return", weekTable, "9:30", monthList);

        weekAll = new int[] { 0 };
        week1   = new int[] { 2, 3 };
        week2   = new int[] { 0 };
        week3   = new int[] { 3 };
        week4   = new int[] { 0 };
        week5   = new int[] { 0 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "0:00";
        Tue = "0:00";
        Wed = "0:00";
        Thu = "0:00";
        Fri = "0:00";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        Circuit.DefaultDate_Create("CrossOver", weekTable, 0, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” date is a Wednesday, set crossover court as GDC (2:00 pm).";
        Circuit.Reminder_Create(reminder, "CrossOver");

        reminder = "If the “whichever comes first” date is a Tuesday, set crossover court as JDR (10:00 am).";
        Circuit.Reminder_Create(reminder, "CrossOver");
    }
    private void JDR_Create()
    {
        DateHandler jdr = new DateHandler("Highland", "Juvenile and Domestic Relations");



        int[] weekAll = new int[] { 0 };
        int[] week1   = new int[] { 2 };
        int[] week2   = new int[] { 0 };
        int[] week3   = new int[] { 0 };
        int[] week4   = new int[] { 0 };
        int[] week5   = new int[] { 0 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "10:00";
        String Tue = "10:00";
        String Wed = "10:00";
        String Thu = "10:00";
        String Fri = "10:00";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        jdr.DefaultDate_Create("Return", weekTable, 1, 1000, DayOfWeekTime);

        String reminder = "If LEO obtains a Class 3 or 4 charge, use LEO’s next court date. If there are any additional charges arising out of the same Class 3 or 4 incident that are issued on a warrant, all the charges (including the Class 3 or 4) should be set for a regular return date.";

        jdr.Reminder_Create(reminder, "Return");


        weekAll = new int[] { 0 }; //	First Tuesday, 10:00 am; or First or third Wednesday, 2:00 pm.
        week1   = new int[] { 2, 3 };
        week2   = new int[] { 0 };
        week3   = new int[] { 3 };
        week4   = new int[] { 0 };
        week5   = new int[] { 0 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };


        Mon = "8:30";
        Tue = "10:00";
        Wed = "14:00";
        Thu = "8:30";
        Fri = "8:30";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        jdr.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” day is a Tuesday, set the “crossover” court as JDR.";
        jdr.Reminder_Create(reminder, "CrossOver");

        reminder = "If the “whichever comes first” day is a Wednesday, set the “crossover” court as GDC.";
        jdr.Reminder_Create(reminder, "CrossOver");

        weekAll = new int[] { 0 };  //***********************1 month expire rule
        week1   = new int[] { 2 };
        week2   = new int[] { 0 };
        week3   = new int[] { 0 };
        week4   = new int[] { 0 };
        week5   = new int[] { 0 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "0:00";
        Tue = "0:00";
        Wed = "0:00";
        Thu = "0:00";
        Fri = "0:00";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        jdr.DefaultDate_Create("EPO", weekTable, 3, 90, DayOfWeekTime);

        reminder = "This means that EPOs in Highland JDR might be good for an entire month.";
        jdr.Reminder_Create(reminder, "EPO");
    }
    protected void EditOkButton_Clicked(object sender, EventArgs e)
    {
        if (SelectedView == ViewMode.LinkSuggestion)
        {
            int linkSuggestionRef;
            if (this.ViewState["EditLinkSuggestionRef"] is int)
            {
                linkSuggestionRef = (int)this.ViewState["EditLinkSuggestionRef"];
                LinkSuggestion linkSuggestion = LinkSuggestion.GetOne(linkSuggestionRef);
                linkSuggestion.Description = LinkSuggestionDescriptionTextBox.Text;
                linkSuggestion.LinkUrl     = LinkSuggestionUrlTextBox.Text;
                linkSuggestion.CategoryRef = int.Parse(LinkSuggestionCategoryDropdownList.SelectedValue);
                linkSuggestion.Save();

                this.ViewState.Remove("EditLinkSuggestionRef");
            }
        }
        else if (SelectedView == ViewMode.LinkAdministration)
        {
            int linkRef;
            if (this.ViewState["EditLinkRef"] is int)
            {
                linkRef = (int)this.ViewState["EditLinkRef"];
                DateTime linkDate;
                DateTime linkTime;
                int      categoryRef, clicks;
                int?     userRef = null;
                double   rating;

                try
                {
                    linkDate = DateHandler.ParseDateString(LinkDateTextBox.Text);
                    linkTime = DateHandler.ParseTimeString(LinkTimeTextBox.Text);
                    linkDate = linkDate.Add(linkTime.TimeOfDay);

                    categoryRef = int.Parse(LinkCategoryDropdownList.SelectedValue);
                    clicks      = int.Parse(LinkClicksTextBox.Text);
                    rating      = double.Parse(LinkRatingTextBox.Text);
                    userRef     = int.Parse(LinkUserDropDownList.SelectedValue);
                    if (userRef == 0)
                    {
                        userRef = null;
                    }
                }
                catch { return; }

                Link link;
                if (linkRef > 0)
                {
                    link = Link.GetOne(linkRef);
                }
                else
                {
                    link = new Link();
                }
                if (link == null)
                {
                    return;
                }

                link.CategoryRef = categoryRef;
                link.Clicks      = clicks;
                link.LinkDate    = linkDate;
                link.LinkName    = LinkNameTextBox.Text;
                link.LinkUrl     = LinkUrlTextBox.Text;
                link.Rating      = rating;
                link.UserRef     = userRef;

                link.Save();

                this.ViewState.Remove("EditLinkRef");
            }
        }
        EditLinkSuggestionPanel.Visible = false;
        EditLinkPanel.Visible           = false;
        base.HideModalBackground();
    }
    protected void EditButton_Clicked(object sender, EventArgs e)
    {
        CuplexLib.User user = Session["User"] as CuplexLib.User;
        if (SelectedView == ViewMode.LinkSuggestion)
        {
            List <int> linkSuggestionRefList = GetPostCollection("SuggestionCheckBox");
            if (linkSuggestionRefList.Count > 0)
            {
                LinkSuggestion linkSuggestion = LinkSuggestion.GetOne(linkSuggestionRefList[0]);
                if (linkSuggestion == null)
                {
                    return;
                }

                LinkSuggestionDescriptionTextBox.Text = linkSuggestion.Description;
                LinkSuggestionUrlTextBox.Text         = linkSuggestion.LinkUrl;

                LinkSuggestionCategoryDropdownList.DataValueField = "CategoryRef";
                LinkSuggestionCategoryDropdownList.DataTextField  = "CategoryName";
                LinkSuggestionCategoryDropdownList.DataSource     = Category.GetCategoryList();
                LinkSuggestionCategoryDropdownList.DataBind();

                try { LinkSuggestionCategoryDropdownList.SelectedValue = linkSuggestion.CategoryRef.ToString(); }
                catch { }

                this.ViewState["EditLinkSuggestionRef"] = linkSuggestion.LinkSuggestionRef;
                EditLinkSuggestionPanel.Visible         = true;
                base.ShowModalBackground();
            }
        }
        else if (SelectedView == ViewMode.LinkAdministration)
        {
            List <int> selectedLinkRefRefList = GetPostCollection("LinkSelectionCheckBox");
            if (selectedLinkRefRefList.Count > 0)
            {
                Link link = Link.GetOne(selectedLinkRefRefList[0]);
                if (link == null)
                {
                    return;
                }

                LinkDateTextBox.Text = DateHandler.ToDateString(link.LinkDate);
                LinkTimeTextBox.Text = DateHandler.ToTimeString(link.LinkDate);
                LinkNameTextBox.Text = link.LinkName;

                LinkCategoryDropdownList.DataValueField = "CategoryRef";
                LinkCategoryDropdownList.DataTextField  = "CategoryName";
                LinkCategoryDropdownList.DataSource     = Category.GetCategoryList();
                LinkCategoryDropdownList.DataBind();

                try { LinkCategoryDropdownList.SelectedValue = link.CategoryRef.ToString(); }
                catch { }

                LinkUserDropDownList.Items.Clear();
                LinkUserDropDownList.Items.Add(new ListItem("null", "0"));

                if (link.UserRef != user.UserRef)
                {
                    LinkUserDropDownList.Items.Add(new ListItem(user.UserName, user.UserRef.ToString()));
                }

                if (link.UserRef != null)
                {
                    LinkUserDropDownList.Items.Add(new ListItem(link.UserName, link.UserRef.Value.ToString()));
                    LinkUserDropDownList.SelectedValue = link.UserRef.Value.ToString();
                }

                LinkUrlTextBox.Text    = link.LinkUrl;
                LinkClicksTextBox.Text = link.Clicks.ToString();
                LinkRatingTextBox.Text = Math.Round(link.Rating, 2).ToString();

                this.ViewState["EditLinkRef"] = link.LinkRef;
                EditLinkPanel.Visible         = true;
                base.ShowModalBackground();
            }
        }
    }
    private void GDC_Create()
    {
        DateHandler gdc = new DateHandler("Botetourt", "General District");



        int[] weekAll = new int[] { 1, 3, 5 }; //no sooner than 5 business days and no more than 20 business days from today’s date.
        int[] week1   = new int[] { 1, 3, 5 };
        int[] week2   = new int[] { 1, 3, 5 };
        int[] week3   = new int[] { 1, 3, 5 };
        int[] week4   = new int[] { 1, 3, 5 };
        int[] week5   = new int[] { 1, 3, 5 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "12:00";
        String Tue = "12:00";
        String Wed = "12:00";
        String Thu = "12:00";
        String Fri = "12:00";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("Return", weekTable, 5, 20, DayOfWeekTime);

        String reminder = "set the following for the LEO's next court date at 9:00 am: - LEO obtains Class 3 or 4 charge; - Misdemeanor bad check, one or two charges where the defendant has no previous criminal charges on his/her record; - Underage Possession of Alcohol where the defendant has no previous criminal charges on his/her record; - Possession of Marijuana where the defendant has no previous drug related charges on his/her record; or - Possession of Schedule III or IV controlled substance where the defendant has no previous drug related charges on his/her record.";

        gdc.Reminder_Create(reminder, "Return");

        reminder = "If one of the charges listed above accompanies any other charge not listed above, set all charges for a regular return date.";
        gdc.Reminder_Create(reminder, "Return");

        weekAll = new int[] { 1, 2, 3, 4, 5 };
        week1   = new int[] { 1, 2, 3, 4, 5 };
        week2   = new int[] { 1, 2, 3, 4, 5 };
        week3   = new int[] { 1, 2, 3, 4, 5 };
        week4   = new int[] { 1, 2, 3, 4, 5 };
        week5   = new int[] { 1, 2, 3, 4, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "8:30";
        Tue = "8:30";
        Wed = "8:30";
        Thu = "8:30";
        Fri = "8:30";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” day is a Monday, second Tuesday, Wednesday, first Thursday, or Friday, set the “crossover” court as GDC.";
        gdc.Reminder_Create(reminder, "CrossOver");

        reminder = "Otherwise, set the “crossover” court as JDR.";
        gdc.Reminder_Create(reminder, "CrossOver");

        weekAll = new int[] { 0 };
        week1   = new int[] { 1, 3, 4, 5 }; //3 days after todays date
        week2   = new int[] { 1, 2, 3, 5 };
        week3   = new int[] { 1, 3, 5 };
        week4   = new int[] { 1, 3, 5 };
        week5   = new int[] { 1, 3, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "0:00";
        Tue = "0:00";
        Wed = "0:00";
        Thu = "0:00";
        Fri = "0:00";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("EPO", weekTable, 3, 1000, DayOfWeekTime);


        weekAll = new int[] { 1, 3, 5 };
        week1   = new int[] { 1, 3, 5 };
        week2   = new int[] { 1, 3, 5 };
        week3   = new int[] { 1, 3, 5 };
        week4   = new int[] { 1, 3, 5 };
        week5   = new int[] { 1, 3, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };


        gdc.DateException_Create("Return", weekTable, 1, 30, "11:00");
    }
    private void JDR_Create()
    {
        DateHandler jdr = new DateHandler("Botetourt", "Juvenile and Domestic Relations");



        int[] weekAll = new int[] { 2 }; //no sooner than 5 business days and no more than 20 business days from today’s date.
        int[] week1   = new int[] { 2 };
        int[] week2   = new int[] { 2 };
        int[] week3   = new int[] { 2 };
        int[] week4   = new int[] { 2 };
        int[] week5   = new int[] { 2 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "8:30";
        String Tue = "8:30";
        String Wed = "8:30";
        String Thu = "8:30";
        String Fri = "8:30";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        jdr.DefaultDate_Create("Return", weekTable, 5, 20, DayOfWeekTime);

        String reminder = "set the following for the LEO's next court date at 10:30 am:- Misdemeanor bad check, one or two charges where the defendant has no previous criminal charges on his/her record.";

        jdr.Reminder_Create(reminder, "Return");

        reminder = "If the charge listed above accompanies any other charge not listed above, set all charges for a regular return date.";
        jdr.Reminder_Create(reminder, "Return");

        reminder = "If LEO obtains a Class 3 or 4 charge, use LEO’s next court date. If there are any additional charges arising out of the same Class 3 or 4 incident that are issued on a warrant, all the charges (including the Class 3 or 4) should be set for a regular return date.";
        jdr.Reminder_Create(reminder, "Return");

        weekAll = new int[] { 1, 2, 3, 4, 5 };
        week1   = new int[] { 1, 2, 3, 4, 5 };
        week2   = new int[] { 1, 2, 3, 4, 5 };
        week3   = new int[] { 1, 2, 3, 4, 5 };
        week4   = new int[] { 1, 2, 3, 4, 5 };
        week5   = new int[] { 1, 2, 3, 4, 5 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "0:00";
        Tue = "0:00";
        Wed = "0:00";
        Thu = "0:00";
        Fri = "0:00";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        jdr.DefaultDate_Create("CrossOver", weekTable, 0, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” day is a Monday, second Tuesday, Wednesday, first Thursday, or Friday, set the “crossover” court as GDC.";
        jdr.Reminder_Create(reminder, "CrossOver");

        reminder = "Otherwise, set the “crossover” court as JDR.";
        jdr.Reminder_Create(reminder, "CrossOver");

        weekAll = new int[] { 2, 4 };  //at least 3 days after today's date
        week1   = new int[] { 2, 4 };
        week2   = new int[] { 2, 4 };
        week3   = new int[] { 2, 4 };
        week4   = new int[] { 2, 4 };
        week5   = new int[] { 2, 4 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };


        Mon = "0:00";
        Tue = "0:00";
        Wed = "0:00";
        Thu = "0:00";
        Fri = "0:00";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        jdr.DefaultDate_Create("EPO", weekTable, 3, 1000, DayOfWeekTime);


        weekAll = new int[] { 2 };
        week1   = new int[] { 2 };
        week2   = new int[] { 2 };
        week3   = new int[] { 2 };
        week4   = new int[] { 2 };
        week5   = new int[] { 2 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };


        jdr.DateException_Create("Return", weekTable, 1, 30, "10:30");
    }
    private void GDC_Create()
    {
        DateHandler gdc = new DateHandler("BuenaVista", "General District");



        int[] weekAll = new int[] { 0 }; //at least two business days out (but no more than two weeks out) from today’s date.
        int[] week1   = new int[] { 4 };
        int[] week2   = new int[] { 4 };
        int[] week3   = new int[] { 4 };
        int[] week4   = new int[] { 4 };
        int[] week5   = new int[] { 4 };

        int[][] weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        String Mon = "9:30";
        String Tue = "9:30";
        String Wed = "9:30";
        String Thu = "9:30";
        String Fri = "9:30";


        String[] DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("Return", weekTable, 2, 14, DayOfWeekTime);

        String reminder = "set the following for the LEO’s next court date (unless the LEO tells you “this one needs an advisement per the CA” – then set regular return date): - Driving without a valid operator’s license (1st offense) – 46.2-300; - Driving suspended or revoked (1st offense) – 46.2-301; - Displaying an improper or fictitious license, registration, or certificate of title –  46.2-613, subparagraph 2; - Allowing and unlicensed person to drive – 46.2-349; - Allowing a suspended/revoked person to drive – 46.2-301.1.E; - Littering on the highway – 33.1-346; - Underage possession of alcohol (1st offense) – 4.1-305; - Use of profane, threatening, etc. language on telephone – 18.2-427; - Reckless driving (generally) – 46.2-852; - Reckless driving (vehicle not under control) – 46.2-853; - Reckless driving (exceeding the speed limit)* – 46.2-862; * - provided the speed is less than 30 mph in excess of the speed limit where the maximum speed limit is 60 mph or less, or less than 95 mph where the maximum speed limit is more than 60 mph. - Show causes issued for non-compliance – driver improvement; and  - Show causes issued for non-compliance – underage alcohol possession.";

        gdc.Reminder_Create(reminder, "Return");

        reminder = "If one of the charges listed above accompanies any other charge not listed above, set all charges for a regular return date.";
        gdc.Reminder_Create(reminder, "Return");

        reminder = "If LEO obtains a Class 3 or 4 charge, use LEO’s next court date. Where there are multiple charges arising out of the same incident, use regular return date for any non-Class 3 or 4 charges.";
        gdc.Reminder_Create(reminder, "Return");



        weekAll = new int[] { 3, 4 };
        week1   = new int[] { 3, 4 };
        week2   = new int[] { 3, 4 };
        week3   = new int[] { 3, 4 };
        week4   = new int[] { 3, 4 };
        week5   = new int[] { 3, 4 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "8:30";
        Tue = "8:30";
        Wed = "8:30";
        Thu = "8:30";
        Fri = "8:30";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("CrossOver", weekTable, 1, 1000, DayOfWeekTime);


        reminder = "If the “whichever comes first” day is a Wednesday, set the “crossover” court as JDR. If the “whichever comes first” day is a Thursday, set the “crossover” court as GDC.";
        gdc.Reminder_Create(reminder, "CrossOver");

        weekAll = new int[] { 4 }; //at least 3 days after today's date
        week1   = new int[] { 4 };
        week2   = new int[] { 4 };
        week3   = new int[] { 4 };
        week4   = new int[] { 4 };
        week5   = new int[] { 4 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };

        Mon = "0:00";
        Tue = "0:00";
        Wed = "0:00";
        Thu = "0:00";
        Fri = "0:00";

        DayOfWeekTime = new[] { "", Mon, Tue, Wed, Thu, Fri, "" };
        gdc.DefaultDate_Create("EPO", weekTable, 3, 1000, DayOfWeekTime);


        weekAll = new int[] { 4 };
        week1   = new int[] { 4 };
        week2   = new int[] { 4 };
        week3   = new int[] { 4 };
        week4   = new int[] { 4 };
        week5   = new int[] { 4 };

        weekTable = new int[6][] { weekAll, week1, week2, week3, week4, week5 };


        gdc.DateException_Create("Return", weekTable, 1, 28, "8:30");
    }
Exemple #32
0
 public void Add(DateHandler handler)
 {
     _dateChangeHandlers.Add(handler);
 }