예제 #1
0
        private void btn_AutoR_Button_Click(object sender, EventArgs e)
        {
            try
            {
                if (SCUtility.isMatche(cb_VhID.Text, ""))
                {
                    TipMessage_Type_Light.Show("", "Please select Vehicle ID.", BCAppConstants.INFO_MSG);
                    return;
                }
                else
                {
                    var confirmResult = TipMessage_Request_Light.Show("Are you sure to change Vehicle Mode ?");

                    if (confirmResult != DialogResult.Yes)
                    {
                        return;
                    }
                    else
                    {
                        TipMessage_Type_Light.Show("Successfully Set Auto Remote", "Successfully the vehicle was set auto remote.", BCAppConstants.INFO_MSG);
                        btn_AutoL.Enabled = true;
                        btn_AutoR.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
예제 #2
0
        private void btn_Cmd_Button_Click(object sender, EventArgs e)
        {
            try
            {
                if (SCUtility.isMatche(cb_MvToStation.Text, ""))
                {
                    TipMessage_Type_Light.Show("", "Please select Station.", BCAppConstants.INFO_MSG);
                    return;
                }
                else
                {
                    var confirmResult = TipMessage_Request_Light.Show("Are you sure to change Station Mode ?");

                    if (confirmResult != DialogResult.Yes)
                    {
                        return;
                    }
                    else
                    {
                        TipMessage_Type_Light.Show("Successfully Command", "Successfully command to vehicle.", BCAppConstants.INFO_MSG);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
        //A0.07 Add Start
        public static Boolean doLogout(System.Windows.Forms.IWin32Window window, WindownApplication app)
        {
            string  loginUserID   = app.LoginUserID;
            Boolean hasLogout     = false;
            var     confirmResult = TipMessage_Request_Light.Show("Are you sure to log out now?");

            if (confirmResult != DialogResult.Yes)
            {
                hasLogout = false;
                return(false);
            }
            else
            {
                app.logoff();
                hasLogout = true;
                TipMessage_Type_Light.Show("", "Logout success!", BCAppConstants.INFO_MSG);
            }
            return(hasLogout);
        }
예제 #4
0
 private void btn_CancelCmd_Button_Click(object sender, EventArgs e)
 {
     try
     {
         var confirmResult = TipMessage_Request_Light.Show("Cancel the vehicle command?");
         if (confirmResult != DialogResult.Yes)
         {
             return;
         }
         else
         {
             TipMessage_Type_Light.Show("Successfully Cancel Command", "Successfully cancel the vehicle command.", BCAppConstants.INFO_MSG);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
 private void tgsw_MTS1_InterLock_MouseCaptureChanged(object sender, EventArgs e)
 {
     try
     {
         if (reflashUI)
         {
             return;
         }
         if (tgsw_MTS1_InterLock.Checked != false)
         {
             var confirmResult = TipMessage_Request_Light.Show("Are you sure to change Interlock Mode ?");
             if (confirmResult != DialogResult.No)
             {
                 TipMessage_Type_Light.Show("Successfully Interlock Off", "Successfully close the MTL/MTS Interlock.", BCAppConstants.INFO_MSG);
                 p_MTS1_Left_Signal.BackgroundImage  = com.mirle.ibg3k0.ohxc.winform.Properties.Resources.MTS_red;
                 p_MTS1_Right_Signal.BackgroundImage = com.mirle.ibg3k0.ohxc.winform.Properties.Resources.MTS_red;
             }
             else
             {
                 tgsw_MTS1_InterLock.Checked = true;
             }
         }
         else
         {
             var confirmResult = TipMessage_Request_Light.Show("Are you sure to change Interlock Mode ?");
             if (confirmResult != DialogResult.Yes)
             {
                 tgsw_MTS1_InterLock.Checked = false;
             }
             else
             {
                 TipMessage_Type_Light.Show("Successfully Interlock", "Successfully open the MTL/MTS Interlock.", BCAppConstants.INFO_MSG);
                 p_MTS1_Left_Signal.BackgroundImage  = com.mirle.ibg3k0.ohxc.winform.Properties.Resources.MTS_green;
                 p_MTS1_Right_Signal.BackgroundImage = com.mirle.ibg3k0.ohxc.winform.Properties.Resources.MTS_green;
             }
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
        private async void ButtonClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (sender.Equals(btn_CancelAbort))
                {
                    var confirmResult = TipMessage_Request_Light.Show("Cancel/Abort the command ?");
                    if (confirmResult != System.Windows.Forms.DialogResult.Yes)
                    {
                        return;
                    }
                    else
                    {
                        TarnferCMDViewObj vmcs_cmd = (TarnferCMDViewObj)grid_MCS_Command.SelectedItem;

                        await Task.Run(() => mSCCommandCancelAbortRequest?.Invoke(this, new MCSCommandCancelAbortEventArgs(vmcs_cmd.CMD_ID.Trim())));

                        //TipMessage_Type_Light.Show("", "Successfully command.", BCAppConstants.INFO_MSG);
                    }
                }
                else if (sender.Equals(btn_Finish))
                {
                    var confirmResult = TipMessage_Request_Light.Show("Force finish the command ?");
                    if (confirmResult != System.Windows.Forms.DialogResult.Yes)
                    {
                        return;
                    }
                    else
                    {
                        TarnferCMDViewObj vmcs_cmd = (TarnferCMDViewObj)grid_MCS_Command.SelectedItem;
                        await Task.Run(() => mSCCommandForceFinishRequest?.Invoke(this, new MCSCommandForceFinishEventArgs(vmcs_cmd.CMD_ID.Trim())));

                        //TipMessage_Type_Light.Show("", "Successfully command.", BCAppConstants.INFO_MSG);
                    }
                }
                else if (sender.Equals(btn_AssignVh))
                {
                    if (grid_MCS_Command.SelectedItem == null)
                    {
                        TipMessage_Type_Light.Show("", "There is no Transfer Command has been selected.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    if (((TarnferCMDViewObj)grid_MCS_Command.SelectedItem).TRANSFERSTATE != E_TRAN_STATUS.Queue)
                    {
                        TipMessage_Type_Light.Show("", "Assign vehicle only for the command which transfer status is queue.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    TarnferCMDViewObj      mcs_cmd       = (TarnferCMDViewObj)grid_MCS_Command.SelectedItem;
                    AssignVehiclePopupForm assignVehicle = new AssignVehiclePopupForm();
                    assignVehicle.readCmdID(mcs_cmd);
                    assignVehicle.ShowDialog();
                }
                else if (sender.Equals(btn_ShiftCmd))
                {
                    if (grid_MCS_Command.SelectedItem == null)
                    {
                        TipMessage_Type_Light.Show("", "There is no Transfer Command has been selected.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    if (((TarnferCMDViewObj)grid_MCS_Command.SelectedItem).TRANSFERSTATE != E_TRAN_STATUS.Initial)
                    {
                        TipMessage_Type_Light.Show("", "Shift command only for the command which transfer status is initial.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    if (string.IsNullOrWhiteSpace(((TarnferCMDViewObj)grid_MCS_Command.SelectedItem).VH_ID))
                    {
                        TipMessage_Type_Light.Show("", "Shift command only for the command which already assign vehicle.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    TarnferCMDViewObj     mcs_cmd      = (TarnferCMDViewObj)grid_MCS_Command.SelectedItem;
                    ShiftCommandPopupForm shiftCommand = new ShiftCommandPopupForm();
                    shiftCommand.readCmdID(mcs_cmd);
                    shiftCommand.ShowDialog();
                }
                else if (sender.Equals(btn_ChangeStatus))
                {
                    if (grid_MCS_Command.SelectedItem == null)
                    {
                        TipMessage_Type_Light.Show("", "There is no Transfer Command has been selected.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    TarnferCMDViewObj     mcs_cmd      = (TarnferCMDViewObj)grid_MCS_Command.SelectedItem;
                    ChangeStatusPopupForm changeStatus = new ChangeStatusPopupForm();
                    changeStatus.readCmdID(mcs_cmd);
                    changeStatus.ShowDialog();
                }
                else if (sender.Equals(btn_ChangePriorty))
                {
                    if (grid_MCS_Command.SelectedItem == null)
                    {
                        TipMessage_Type_Light.Show("", "There is no Transfer Command has been selected.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    if (((TarnferCMDViewObj)grid_MCS_Command.SelectedItem).TRANSFERSTATE != E_TRAN_STATUS.Queue)
                    {
                        TipMessage_Type_Light.Show("", "Priority Change only for the command which transfer status is queue.", BCAppConstants.WARN_MSG);
                        return;
                    }
                    //ChangePriorityPopupForm changePriority = new ChangePriorityPopupForm(((TarnferCMDViewObj)grid_MCS_Command.SelectedItem).CMD_ID.Trim());
                    //changePriority.ShowDialog();

                    string mcs_cmd = ((TarnferCMDViewObj)grid_MCS_Command.SelectedItem).CMD_ID.Trim();
                    ChangePriorityPopupForm changePriority = new ChangePriorityPopupForm();
                    changePriority.readCmdID(mcs_cmd);
                    changePriority.ShowDialog();
                }
                else if (sender.Equals(btn_Export))
                {
                    if (CsvUtility.exportLotDataToCSV(app.ObjCacheManager.GetMCS_CMD()))
                    {
                        TipMessage_Type_Light_woBtn.Show("", "Export data completed.", BCAppConstants.INFO_MSG);
                    }
                    else
                    {
                        TipMessage_Type_Light.Show("", "Export data failed.", BCAppConstants.WARN_MSG);
                    }
                }
                else if (sender.Equals(btn_Close))
                {
                    if (TogBtn_McsQUpdate.Toggled1 == false)
                    {
                        await Task.Run(() => mSCCommandAutoAssignChange?.Invoke(this, new MCSCommandAutoAssignUpdateEventArgs(true.ToString())));
                    }
                    CloseFormEvent?.Invoke(this, e);
                }
            }
            catch (Exception ex)
            { logger.Error(ex, "Exception"); }
        }