private void uc_UpdateUserAccountRequest(object sender, uc_AccountManagement.UserEventArgs e)
        {
            try
            {
                string  result        = string.Empty;
                Boolean updateSuccess =
                    app.LineBLL.SendUserAccountUpdateRequest(
                        e.userID,
                        e.password,
                        e.user_name,
                        e.disable_flag,
                        e.grp_id,
                        e.badge_num,
                        e.department,
                        out result);

                if (updateSuccess)
                {
                    TipMessage_Type_Light.Show("Succeed", "Update Success.", BCAppConstants.INFO_MSG);
                    Refresh(TabItem_UA, null);
                }
                else
                {
                    TipMessage_Type_Light.Show("Failure", "Update Failed.", BCAppConstants.INFO_MSG);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
        private void uc_UpdateUserGroupRequest(object sender, GroupEventArgs e)
        {
            try
            {
                string  result        = string.Empty;
                Boolean updateSuccess =
                    app.LineBLL.SendUserGroupUpdateRequest(
                        e.grp_id,
                        e.funcCloseSystem,
                        e.funcSystemControlMode,
                        e.funcLogin,
                        e.funcAccountManagement,
                        e.funcVehicleManagement,
                        e.funcTransferManagement,
                        e.funcMTLMTSMaintenance,
                        e.funcPortMaintenance,
                        e.funcDebug,
                        e.funcAdvancedSetting,
                        out result);

                if (updateSuccess)
                {
                    TipMessage_Type_Light.Show("Succeed", "Update Success.", BCAppConstants.INFO_MSG);
                    Refresh(TabItem_GA, null);
                }
                else
                {
                    TipMessage_Type_Light.Show("Failure", "Update Failed.", BCAppConstants.INFO_MSG);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
 private void MTSMTLInterlockChange(object sender, MTSMTLInterlockChangeEventArgs e)
 {
     try
     {
         Task.Run(() =>
         {
             if (!app.LineBLL.SendMTSMTLCarOutInterlock(e.station_id, e.is_set, out string result))
             {
                 //MessageBox.Show(result);
                 Adapter.Invoke((obj) =>
                 {
                     refreshUI();
                 }, null);
                 TipMessage_Type_Light.Show("", result, BCAppConstants.WARN_MSG);
             }
             else
             {
                 TipMessage_Type_Light.Show("", "Interlock Change Request Succeed", BCAppConstants.INFO_MSG);
             }
             //app.LineBLL.SendHostModeChange(e.host_mode);
         });
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 4
0
 private void uc_Exit_SendExitRequest(object sender, uc_Exit.ExitRequestEventArgs e)
 {
     try
     {
         string  result      = string.Empty;
         Boolean exitSuccess = app.LineBLL.SendExitRequest(e.userID, e.password, out result);
         if (exitSuccess)
         {
             //驗證成功
             //System.Windows.Forms.DialogResult dialog = new System.Windows.Forms.DialogResult();
             //dialog = System.Windows.Forms.DialogResult.OK;
             //DialogResult = true;
             CloseFormEvent?.Invoke(this, e);
             TipMessage_Type_Light_woBtn.Show("Succeed", "Exit Successful.", BCAppConstants.INFO_MSG);
             //form.Close();
         }
         else
         {
             TipMessage_Type_Light.Show("Failure", "Exit Failed.", BCAppConstants.INFO_MSG);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 5
0
        private async void MTSMTLCarInInterlockChange(object sender, MTSMTLInterlockChangeEventArgs e)
        {
            try
            {
                bool   is_success = false;
                string result     = "";
                await Task.Run(() =>
                {
                    is_success = app.LineBLL.SendMTSMTLCarInInterlock(e.station_id, e.is_set, out result);
                });

                if (is_success)
                {
                    TipMessage_Type_Light.Show("", "Interlock Change Request Succeed", BCAppConstants.INFO_MSG);
                }
                else
                {
                    TipMessage_Type_Light.Show("", result, BCAppConstants.WARN_MSG);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
Esempio n. 6
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");
            }
        }
Esempio n. 7
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");
            }
        }
Esempio n. 8
0
 public string getLoginPassword() //A0.02
 {
     if (BCFUtility.isMatche(uc_Exit.password_box.Password, ""))
     {
         TipMessage_Type_Light.Show("Failure", "Please input password.", BCAppConstants.WARN_MSG);
     }
     return(uc_Exit.password_box.Password);
 }
Esempio n. 9
0
        private async Task search()
        {
            try
            {
                if (SCUtility.isEmpty(m_StartDTCbx.Value.ToString()))
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Please select start time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (SCUtility.isEmpty(m_EndDTCbx.Value.ToString()))
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Please select end time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (DateTime.Compare(System.Convert.ToDateTime(m_StartDTCbx.Value), System.Convert.ToDateTime(m_EndDTCbx.Value)) == 1)
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Start time must occur earlier than end time. Please re-enter start time and end time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (DateTime.Compare(System.Convert.ToDateTime(m_StartDTCbx.Value), System.Convert.ToDateTime(m_EndDTCbx.Value)) < 0)
                {
                    btn_Search.IsEnabled = false;
                    DateTime dateTimeFrom = System.Convert.ToDateTime(m_StartDTCbx.Value);
                    DateTime dateTimeTo   = System.Convert.ToDateTime(m_EndDTCbx.Value);
                    //string keyword = string.Empty;
                    //if (SCUtility.isMatche(McsCmdLog_CstID.Text, ""))
                    //{
                    //    keyword = string.Empty;
                    //}
                    //else
                    //{
                    //    keyword = McsCmdLog_CstID.Text.Trim();
                    //}
                    dateTimeFrom = new DateTime(dateTimeFrom.Year, dateTimeFrom.Month, dateTimeFrom.Day, dateTimeFrom.Hour, dateTimeFrom.Minute, dateTimeFrom.Second, DateTimeKind.Local);
                    dateTimeTo   = new DateTime(dateTimeTo.Year, dateTimeTo.Month, dateTimeTo.Day, dateTimeTo.Hour, dateTimeTo.Minute, dateTimeTo.Second, DateTimeKind.Local);
                    string cmd_id = CommunLog_MCSCmdID.Text;
                    string vh_id  = CommunLog_VhID.Text;
                    List <RecordReportInfo> record_report_info = null;
                    await Task.Run(() => record_report_info = sysExcuteQualityQueryService.loadRecodeReportInfo(dateTimeFrom, dateTimeTo, vh_id, cmd_id));

                    if (record_report_info.Count <= 0)
                    {
                        TipMessage_Type_Light.Show("Warning", "There is no matching data for your query.", BCAppConstants.WARN_MSG);
                    }
                    else
                    {
                        record_report_info = record_report_info.OrderBy(info => info.Timestamp).ToList();
                        uctl_ElasticQuery_sys_process_log.setDataItemsSource(record_report_info);
                    }
                    btn_Search.IsEnabled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
Esempio n. 10
0
        private async Task search()
        {
            try
            {
                if (SCUtility.isEmpty(m_StartDTCbx.Value.ToString()))
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Please select start time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (SCUtility.isEmpty(m_EndDTCbx.Value.ToString()))
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Please select end time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (DateTime.Compare(System.Convert.ToDateTime(m_StartDTCbx.Value), System.Convert.ToDateTime(m_EndDTCbx.Value)) == 1)
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Start time must occur earlier than end time. Please re-enter start time and end time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (DateTime.Compare(System.Convert.ToDateTime(m_StartDTCbx.Value), System.Convert.ToDateTime(m_EndDTCbx.Value)) < 0)
                {
                    btn_Search.IsEnabled = false;
                    DateTime dateTimeFrom = System.Convert.ToDateTime(m_StartDTCbx.Value);
                    DateTime dateTimeTo   = System.Convert.ToDateTime(m_EndDTCbx.Value);
                    string   keyword      = string.Empty;
                    if (SCUtility.isMatche(McsCmdLog_CstID.Text, ""))
                    {
                        keyword = string.Empty;
                    }
                    else
                    {
                        keyword = McsCmdLog_CstID.Text.Trim();
                    }

                    dateTimeFrom = new DateTime(dateTimeFrom.Year, dateTimeFrom.Month, dateTimeFrom.Day, dateTimeFrom.Hour, dateTimeFrom.Minute, dateTimeFrom.Second, DateTimeKind.Local);
                    dateTimeTo   = new DateTime(dateTimeTo.Year, dateTimeTo.Month, dateTimeTo.Day, dateTimeTo.Hour, dateTimeTo.Minute, dateTimeTo.Second, DateTimeKind.Local);
                    List <ASYSEXCUTEQUALITY> system_qualitys = null;
                    await Task.Run(() => system_qualitys = sysExcuteQualityQueryService.loadSysexcutequalities(dateTimeFrom, dateTimeTo));

                    if (system_qualitys.Count <= 0)
                    {
                        TipMessage_Type_Light.Show("Warning", "There is no matching data for your query.", BCAppConstants.WARN_MSG);
                    }
                    else
                    {
                        system_qualitys = system_qualitys.OrderBy(info => info.CMD_INSERT_TIME).ToList();
                        uctl_ElasticQuery_CMDExcute_1.setDataItemsSource(system_qualitys);
                    }
                    btn_Search.IsEnabled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
        private async Task search()
        {
            try
            {
                if (SCUtility.isEmpty(m_StartDTCbx.Value.ToString()))
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Please select start time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (SCUtility.isEmpty(m_EndDTCbx.Value.ToString()))
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Please select end time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (DateTime.Compare(System.Convert.ToDateTime(m_StartDTCbx.Value), System.Convert.ToDateTime(m_EndDTCbx.Value)) == 1)
                {
                    TipMessage_Type_Light.Show("Failure", String.Format("Start time must occur earlier than end time. Please re-enter start time and end time."), BCAppConstants.WARN_MSG);
                    return;
                }
                if (DateTime.Compare(System.Convert.ToDateTime(m_StartDTCbx.Value), System.Convert.ToDateTime(m_EndDTCbx.Value)) < 0)
                {
                    btn_Search.IsEnabled = false;
                    DateTime dateTimeFrom = System.Convert.ToDateTime(m_StartDTCbx.Value);
                    DateTime dateTimeTo   = System.Convert.ToDateTime(m_EndDTCbx.Value);

                    dateTimeFrom = new DateTime(dateTimeFrom.Year, dateTimeFrom.Month, dateTimeFrom.Day, dateTimeFrom.Hour, dateTimeFrom.Minute, dateTimeFrom.Second, DateTimeKind.Local);
                    dateTimeTo   = new DateTime(dateTimeTo.Year, dateTimeTo.Month, dateTimeTo.Day, dateTimeTo.Hour, dateTimeTo.Minute, dateTimeTo.Second, DateTimeKind.Local);
                    string every_hour_interval = EveryHourInterval.Text;
                    string alarm_code          = AlarmCode.Text;
                    string vh_id         = cb_VehicleIDs.Text;
                    bool   include_set   = ck_IsSet.IsChecked.HasValue ? ck_IsSet.IsChecked.Value : false;
                    bool   include_clear = ck_IsClear.IsChecked.HasValue ? ck_IsClear.IsChecked.Value : false;
                    List <AlarmObjToShow> alarms_obj_to_show = null;
                    await Task.Run(() =>
                    {
                        var alarms         = AlarmBLL.loadAlarmByConditions(dateTimeFrom, dateTimeTo, include_set, include_clear, vh_id, alarm_code);
                        alarms_obj_to_show = alarms.Select(alarm => new AlarmObjToShow(alarm, AlarmBLL)).ToList();
                    });

                    if (alarms_obj_to_show.Count <= 0)
                    {
                        TipMessage_Type_Light.Show("Warning", "There is no matching data for your query.", BCAppConstants.WARN_MSG);
                    }
                    else
                    {
                        uctl_AlarmList.setDataItemsSource(alarms_obj_to_show);
                    }
                    btn_Search.IsEnabled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
Esempio n. 12
0
 private async void btn_Confirm_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (identity == BCAppConstants.SubPageIdentifier.TRANSFER_CHANGE_STATUS)
         {
             string status = string.Empty;
             Adapter.BeginInvoke(new SendOrPostCallback(async(o1) =>
             {
                 E_TRAN_STATUS ee = ((E_TRAN_STATUS)ComboBox.SelectedItem);
                 status           = ee.ToString();
                 await Task.Run(() => mSCCommandStatus?.Invoke(this, new MCSCommandStatusChangeEventArgs(mcs_cmd_id, status)));
             }), null);
         }
         else if (identity == BCAppConstants.SubPageIdentifier.TRANSFER_ASSIGN_VEHICLE)
         {
             string vhid = string.Empty;
             Adapter.BeginInvoke(new SendOrPostCallback(async(o1) =>
             {
                 if (ComboBox.SelectedItem == null)
                 {
                     TipMessage_Type_Light.Show("", "No vehicle has been selected.", BCAppConstants.INFO_MSG);
                     return;
                 }
                 vhid = ComboBox.SelectedItem.ToString();
                 await Task.Run(() => mSCCommandAssignVehicle?.Invoke(this, new MCSCommandAssignVeicleEventArgs(mcs_cmd_id, vhid)));
             }), null);
         }
         else if (identity == BCAppConstants.SubPageIdentifier.TRANSFER_SHIFT_COMMAND)
         {
             string vhid = string.Empty;
             Adapter.BeginInvoke(new SendOrPostCallback(async(o1) =>
             {
                 if (ComboBox.SelectedItem == null)
                 {
                     TipMessage_Type_Light.Show("", "No vehicle has been selected.", BCAppConstants.INFO_MSG);
                     return;
                 }
                 vhid = ComboBox.SelectedItem.ToString();
                 await Task.Run(() => mCSCommandShift?.Invoke(this, new MCSCommandShiftEventArgs(mcs_cmd_id, vhid)));
             }), null);
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
 private void LinkStatusChange(object sender, LinkStatusUpdateEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendLinkStatusChange(e.linkstatus, out string result))
         {
             //TipMessage_Type_Light.Show("Change Failure", "Communicating status can't be off.", BCAppConstants.INFO_MSG);
             TipMessage_Type_Light.Show("Change Failure", result, BCAppConstants.INFO_MSG);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 14
0
 private void Uc_SP_PathControlList_SegmentCVEnable(object sender, SegmentStatusUpdateEventArgs e)
 {
     try
     {
         var send_result = app.SegmentBLL.webAPI.SendSegmentStatusUpdate(e.seg_id, ASEGMENT.DisableType.Safety, E_SEG_STATUS.Active);
         if (!send_result.isSuccess)
         {
             TipMessage_Type_Light.Show("Failure", send_result.result, BCAppConstants.WARN_MSG);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
 private void TSCStateChange(object sender, TSCStateUpdateEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendTSCStateChange(e.tscstate, out string result))
         {
             //MessageBox.Show(result);
             TipMessage_Type_Light.Show("Change Failure", result, BCAppConstants.INFO_MSG);
         }
         //app.LineBLL.SendHostModeChange(e.host_mode);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 16
0
 private void uc_Login_SendLogInRequest(object sender, LogInRequestEventArgs e)
 {
     try
     {
         string result = string.Empty;
         if (app.LineBLL.SendLogInRequest(e.userID, e.password, out result))
         {
             CloseFormEvent?.Invoke(this, e);
             TipMessage_Type_Light_woBtn.Show("", "Login Successful.", BCAppConstants.INFO_MSG);
             app.login(e.userID);
         }
         else
         {
             TipMessage_Type_Light.Show("", "Login Fail.", BCAppConstants.WARN_MSG);
         }
     }
     catch (Exception ex) { logger.Error(ex, "Exception"); }
 }
 private void MSCCommandAutoAssignChange(object sender, MCSCommandAutoAssignUpdateEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendMCSCommandAutoAssignChange(e.autoAssign, out string result))
         {
             TipMessage_Type_Light.Show("", result, BCAppConstants.WARN_MSG);
         }
         else
         {
         }
         //app.LineBLL.SendHostModeChange(e.host_mode);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 18
0
 private void VehicleCommandCancelAbortSend(object sender, VehicleCMDCancelAbortEventArgs e)
 {
     try
     {
         if (!app.VehicleBLL.SendVehicleCMDCancelAbortToControl(e.vh_id, out string result))
         {
             TipMessage_Type_Light.Show("Send Cancel/Abort failed", result, BCAppConstants.INFO_MSG);
         }
         else
         {
             TipMessage_Type_Light.Show("Send Cancel/Abort succeed", "", BCAppConstants.INFO_MSG);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 19
0
 private void VehicleCarOutCancelSend(object sender, VehicleCarOutCancelEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendMTSMTLCarOurCancel(e.station_id, out string result))
         {
             TipMessage_Type_Light.Show("Send Carout cancel failed", result, BCAppConstants.INFO_MSG);
         }
         else
         {
             TipMessage_Type_Light.Show("Send Carout cancel succeed", "", BCAppConstants.INFO_MSG);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 20
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");
     }
 }
        //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);
        }
 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 void MSCCommandForceFinish(object sender, MCSCommandForceFinishEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendMCSCommandForceFinish(e.mcs_cmd, out string result))
         {
             //MessageBox.Show(result);
             TipMessage_Type_Light.Show("", result, BCAppConstants.WARN_MSG);
         }
         else
         {
             TipMessage_Type_Light_woBtn.Show("", "Force Finish Succeed", BCAppConstants.INFO_MSG);
         }
         //app.LineBLL.SendHostModeChange(e.host_mode);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 24
0
 private void ModeStatusChange(object sender, ModeStatusChangeEventArgs e)
 {
     try
     {
         if (!app.VehicleBLL.SendModeStatusChange(e.vh_id, e.modeStatus, out string result))
         {
             //MessageBox.Show(result);
             TipMessage_Type_Light.Show("Change status failed", result, BCAppConstants.INFO_MSG);
         }
         else
         {
             TipMessage_Type_Light.Show("Change status succeed", "", BCAppConstants.INFO_MSG);
         }
         //app.LineBLL.SendHostModeChange(e.host_mode);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 25
0
 private void VehicleCarOutRequestSend(object sender, VehicleCarOutRequestEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendMTSMTLCarOurRequest(e.vh_id, e.station_id, out string result))
         {
             //MessageBox.Show(result);
             TipMessage_Type_Light.Show("Send command failed", result, BCAppConstants.INFO_MSG);
         }
         else
         {
             TipMessage_Type_Light.Show("Send command succeeded", "", BCAppConstants.INFO_MSG);
         }
         //app.LineBLL.SendHostModeChange(e.host_mode);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 26
0
 private void VehicleCommandSend(object sender, VehicleCommandEventArgs e)
 {
     try
     {
         if (!app.VehicleBLL.SendCmdToControl(e.vh_id, e.cmd_type, e.carrier_id, e.source, e.destination, out string result))
         {
             //MessageBox.Show(result);
             TipMessage_Type_Light.Show("Send command failed", result, BCAppConstants.INFO_MSG);
         }
         else
         {
             TipMessage_Type_Light.Show("Send command succeeded", "", BCAppConstants.INFO_MSG);
         }
         //app.LineBLL.SendHostModeChange(e.host_mode);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 27
0
 private void MCSCommandShift(object sender, MCSCommandShiftEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendMCSCommandShift(e.mcs_cmd, e.vh_id, out string result))
         {
             TipMessage_Type_Light.Show("", result, BCAppConstants.WARN_MSG);
         }
         else
         {
             Adapter.Invoke(new SendOrPostCallback((o1) =>
             {
                 CloseFormEvent?.Invoke(this, e);
             }), null);
             TipMessage_Type_Light_woBtn.Show("", "Shift Command Succeed", BCAppConstants.INFO_MSG);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 28
0
 private void uc_PasswordChange_SendPasswordChange(object sender, uc_PasswordChange.PasswordChangeEventArgs e)
 {
     try
     {
         string result = string.Empty;
         if (app.LineBLL.SendPasswordChange(e.userID, e.password_o, e.password_n, e.password_v, out result))
         {
             //變更成功
             TipMessage_Type_Light_woBtn.Show("", "Update Successful.", BCAppConstants.INFO_MSG);
             CloseFormEvent?.Invoke(this, e);
         }
         else
         {
             //變更失敗
             TipMessage_Type_Light.Show("", result, BCAppConstants.WARN_MSG);
             return;
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
        private void uc_DeleteUserGroupRequest(object sender, uc_AccountManagement.GroupEventArgs e)
        {
            try
            {
                string  result        = string.Empty;
                Boolean deleteSuccess =
                    app.LineBLL.SendUserGroupDeleteRequest(e.grp_id, out result);

                if (deleteSuccess)
                {
                    TipMessage_Type_Light.Show("Succeed", "Update Success.", BCAppConstants.INFO_MSG);
                    Refresh(TabItem_GA, null);
                }
                else
                {
                    TipMessage_Type_Light.Show("Failure", "Update Failed.", BCAppConstants.INFO_MSG);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
Esempio n. 30
0
 private void MSCCommandPriorityChange(object sender, MCSCommandPriortyChangeEventArgs e)
 {
     try
     {
         if (!app.LineBLL.SendMCSCommandChangePriority(e.mcs_cmd, e.priority, out string result))
         {
             //MessageBox.Show(result);
             TipMessage_Type_Light.Show("", result, BCAppConstants.WARN_MSG);
         }
         else
         {
             Adapter.Invoke(new SendOrPostCallback((o1) =>
             {
                 CloseFormEvent?.Invoke(this, e);
             }), null);
             TipMessage_Type_Light.Show("", "Priority Change Succeed", BCAppConstants.INFO_MSG);
         }
         //app.LineBLL.SendHostModeChange(e.host_mode);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }