Пример #1
0
        public void Action_UpdateDock(object sender, EventArgs e)
        {
            DSInteractiveEntry     dsie = sender as DSInteractiveEntry;
            DSInteractiveEntryData data = dsie.DataContext as DSInteractiveEntryData;

            if (data.Dock != "0" && data.Dock != "")
            {
                SQL_dockSchedule.InsertDockNumber(data.Dock, data.PairId);
            }
            else
            {
                SQL_dockSchedule.ClearDockNumber(data.PairId);
            }
        }
Пример #2
0
        //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        //''''''''''''''''''''''''''''''''''''           PANEL BUTTONS           ''''''''''''''''''''''''''''''''''''
        //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        public void Action_UpdateRow(object sender, EventArgs e)
        {
            DSInteractiveEntry     dsie = sender as DSInteractiveEntry;
            DSInteractiveEntryData data = dsie.DataContext as DSInteractiveEntryData;
            string id = data.PairId;

            var now = DateTime.Now;

            if (data.Action == DSInteractiveEntryData.MARK_ARRIVED)
            {
                //LATE ARRIVAL HIGHLIGHT-------------------------
                SQL_search.RunQuery("db_Sandbar", $"SELECT * FROM DS_entries WHERE ID = {id}");

                var scheduleTime = SQL_search.Ds.Tables[0].Rows[0]["SCHEDULE_TIME"].ToString();
                var displayTime  = DateTime.Parse(scheduleTime, new CultureInfo("en-US", true));

                if (DateTime.Now > displayTime)
                {
                    data.MarkLate();
                }
                //-----------------------------------------------

                data.Action       = DSInteractiveEntryData.SENT_TO_DOCK;
                data.ArrivedValue = now.ToShortTimeString();

                SQL_dockSchedule.InsertTime("ARRIVAL_TIME", id);
            }
            else if (data.Action == DSInteractiveEntryData.SENT_TO_DOCK)
            {
                data.Action   = DSInteractiveEntryData.ARRIVED_AT_DOCK;
                data.STDValue = now.ToShortTimeString();

                SQL_dockSchedule.InsertTime("SENT_TIME", id);
            }
            else if (data.Action == DSInteractiveEntryData.ARRIVED_AT_DOCK)
            {
                data.Action      = DSInteractiveEntryData.DEPARTED_DOCK;
                data.TimeInValue = now.ToShortTimeString();

                SQL_dockSchedule.InsertTime("IN_TIME", id);
            }
            else if (data.Action == DSInteractiveEntryData.DEPARTED_DOCK)
            {
                SQL_dockSchedule.InsertTime("OUT_TIME", id);
                LoadDailySchedule();
            }
        }
Пример #3
0
 public void Action_NoShowCategory(int i)
 {
     SQL_dockSchedule.InsertCancel(_parent.CancelDisplayPairId.Content.ToString(), i.ToString());
     LoadDailySchedule();
     _parent.CancelDialogPanel.Visibility = Visibility.Collapsed;
 }