/// <summary> /// 配对 /// </summary> private void MatchDevice() { LoginWindow loginWindow = WindowsHelper.ShowDialogWindow <LoginWindow>(parentWindow, PermissionConfig.DeviceMatch, "1"); if (loginWindow.MessageBoxResult == MessageBoxResult.OK) { // 防止执法记录仪在验证过程中拔掉 DeviveInfo selectDevice = GatherViewModel.DeviveInfoList.Find(p => p.DeviceCode.Equals(deviveInfo.DeviceCode)); if (selectDevice == null) { NewMessageBox.Show(string.Format(TryFindResource("GatherDeviceRemove").ToString(), deviveInfo.DeviceCode), parentWindow); return; } if (AppConfigInfos.LimitsUserInfos.UserType == "1") { // 调度员可以帮其他人配对 WindowsHelper.ShowDialogWindow <MatchWindow>(parentWindow, deviveInfo); } else { MatchDeviceByNormalPolice(); } } }
private void btnStart_Click(object sender, RoutedEventArgs e) { tbMsg.Text = string.Empty; string delValue = string.Empty; string editorValue = string.Empty; List <Finger> newFingers = GetNewFinger(); GetChangeValue(ref delValue, ref editorValue, userInfo.Fingers, newFingers); Conditions con = new Conditions(); con.AddItem("UserID", userInfo.UserID); con.AddItem("FingersEditor", editorValue); con.AddItem("FingersDelete", delValue); // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.FingerEditorRequest, MsgType.FingerEditorRespond, con, TryFindResource("FingerEditorData").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("FingerEditorOverTime").ToString(); } else if (msgBoxResult == MessageBoxResult.Yes) { ModelResponsible.Instance.SendOperationLog("CollectFingerEditor"); isClose = true; this.Close(); NewMessageBox.ShowTip(TryFindResource("FingerEditorSuccess").ToString(), ModelResponsible.Instance.ParentWindow); } else if (msgBoxResult == MessageBoxResult.No) { tbMsg.Text = TryFindResource("FingerEditorFail").ToString(); } }
private void btnSure_Click(object sender, RoutedEventArgs e) { tbMsg.Text = string.Empty; if (object.Equals(cbTypes.SelectedValue, null)) { tbMsg.Text = TryFindResource("GatherInputDeviceType").ToString(); return; } if (string.IsNullOrWhiteSpace(tbPassword.Password)) { tbMsg.Text = TryFindResource("GatherInputPasswrod").ToString(); return; } DeviveInfo selectDevice = GatherViewModel.DeviveInfoList.Find(p => p.DeviceCode.Equals(DeviveInfo.DeviceCode)); if (selectDevice == null) { NewMessageBox.Show(string.Format(TryFindResource("GatherDeviceRemove").ToString(), DeviveInfo.DeviceCode)); return; } Conditions con = new Conditions(); con.AddItem("UserID", AppConfigInfos.CurrentUserInfos.UserID); con.AddItem("DeviceID", DeviveInfo.DeviceCode); con.AddItem("DevicePassword", tbPassword.Password); con.AddItem("TypeID", cbTypes.SelectedValue.ToString()); // 发送注册消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.DeviceRegister, MsgType.DeviceRegisterResult, con, TryFindResource("GatherRegistering").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("GatherRegisterOvertime").ToString(); } else if (msgBoxResult == MessageBoxResult.Yes) { ModelResponsible.Instance.SendOperationLog("CollectDeviceRegister"); this.Close(); //NewMessageBox.Show(TryFindResource("GatherRegisterSuccess").ToString(), ModelResponsible.Instance.ParentWindow); } else if (msgBoxResult == MessageBoxResult.No) { DeviceRegisterInfo deviceRegisterInfo = resultWindow.ResultValue as DeviceRegisterInfo; if (deviceRegisterInfo != null) { string msg = (TryFindResource("GatherDeviceRegisterError_" + deviceRegisterInfo.ResultCode) ?? string.Empty).ToString(); tbMsg.Text = msg; } else { tbMsg.Text = TryFindResource("GatherRegisterFailed").ToString(); } } }
/// <summary> /// 告警明细 /// </summary> /// <param name="als"></param> public void SearchAlarmLogDetail(AlarmLogsSearch als, bool showWindow = true) { if (!AppHelper.CheckAppState(ModelResponsible.Instance.ParentWindow)) { return; } Conditions cons = new Conditions(); cons.AddItem("AlarmLevel", als.IsAdvanced ? als.AlarmLevel : ""); cons.AddItem("AlarmCode", als.IsAdvanced ? als.AlarmCode : ""); cons.AddItem("AlarmModule", (als.IsAdvanced && !string.IsNullOrEmpty(als.AlarmModule)) ? als.AlarmModule : "16,17,18,19,21,23,25,28"); cons.AddItem("AlarmStatus", als.IsAdvanced ? als.AlarmStatus : ""); cons.AddItem("AlarmIp", EEMSConfigHelper.GetValueByCommomConfig("config/CommonConfig/local_machine_ip", "127.0.0.1")); cons.AddItem("AlarmStartTime", als.AlarmStartTime); cons.AddItem("AlarmEndTime", als.SearchTime); cons.AddItem("PageIndex", als.PageIndex.ToString()); cons.AddItem("PageCount", als.PageCount.ToString()); if (showWindow) { ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(null, MsgType.AlarmLogRequest, MsgType.AlarmLogRespond, cons, Application.Current.FindResource("SearchManagerSearch").ToString(), AppConfigInfos.AppStateInfos.SearchTimeOut); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(Application.Current.FindResource("SearchManagerSearchFail").ToString()); } } else { ModelResponsible.Instance.SendMessage(MsgType.AlarmLogRequest, cons); } }
private void btnAdd_Click(object sender, RoutedEventArgs e) { MediaInfo dataContext = (MediaInfo)this.DataContext; bool isHas = ModelResponsible.Instance.AnalyzeHisPlayMediaList(dataContext); switch (dataContext.MediaType) { case "1": ModelResponsible.Instance.AnalyzeVideoPlayMediaList(dataContext); break; case "2": ModelResponsible.Instance.AnalyzeVoicePlayMediaList(dataContext); break; case "3": ModelResponsible.Instance.AnalyzePicturePlayMediaList(dataContext); break; } LogHelper.Instance.WirteLog(string.Format("FileButtonControl: UserCode:{0} btnAdd", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug); if (isHas) { NewMessageBox.ShowTip(TryFindResource("FileButtonControlAddSucceed").ToString()); } else { NewMessageBox.ShowTip(TryFindResource("FileButtonControlAddRepeat").ToString()); } }
private void btnPaly_Click(object sender, RoutedEventArgs e) { LogHelper.Instance.WirteLog(string.Format("FileButtonControl: UserCode:{0} btnPlay", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug); if ((MediaInfo)this.DataContext != null) { string filepath = ((MediaInfo)this.DataContext).FilePath + ((MediaInfo)this.DataContext).FileName; if (!System.IO.File.Exists(filepath)) { NewMessageBox.Show(TryFindResource("SearchManagerPlayFileNoData").ToString()); return; } WindowsHelper.GetOrNewWindow <PlayWindow>(true).UpdateSelectTab((MediaInfo)this.DataContext); LogHelper.Instance.WirteLog(string.Format("FileButtonControl: UserCode:{0} btnPlay AddHisPlayMediaList", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug); ModelResponsible.Instance.AnalyzeHisPlayMediaList((MediaInfo)this.DataContext); LogHelper.Instance.WirteLog(string.Format("FileButtonControl: UserCode:{0} btnPlay Playing", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug); SearchManager.GetInstance().SendOperationLog("CollectEvidencePlay", (MediaInfo)this.DataContext); WindowsHelper.ShowDialogWindow <PlayWindow>(ModelResponsible.Instance.ParentWindow); } else { LogHelper.Instance.WirteLog(string.Format("FileButtonControl: UserCode:{0} btnPlay NoMediaInfo", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug); } }
/// <summary> /// 查询信息 /// </summary> /// <param name="pageIndex">页索引</param> /// <param name="tipInfo"></param> /// <param name="overInfo"></param> /// <param name="failInfo"></param> private void SearchInfo(string pageIndex, string tipInfo, string overInfo, string failInfo) { MoreVisibility = Visibility.Collapsed; Conditions con = new Conditions(); con.AddItem("OrgID", lastOrgId); con.AddItem("UserName", lastName); con.AddItem("PageIndex", pageIndex); con.AddItem("PageCount", AppConfigInfos.AppStateInfos.SearchPageCount.ToString()); // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(parentWindow, MsgType.FingerInfosRequest, MsgType.FingerInfosRespond, con, TryFindResource(tipInfo).ToString(), 60); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(TryFindResource(overInfo).ToString(), parentWindow); } else if (msgBoxResult == MessageBoxResult.Yes) { MoreVisibility = FingerViewModel.IsMoreData ? Visibility.Visible : Visibility.Collapsed; spNodata.Visibility = lvData.Items.Count == 0 ? Visibility.Visible : Visibility.Collapsed; ModelResponsible.Instance.SendOperationLog("CollectSearchFinger"); } else if (msgBoxResult == MessageBoxResult.No) { NewMessageBox.Show(TryFindResource(failInfo).ToString(), parentWindow); } }
/// <summary> /// 主窗口关闭,系统退出 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { // 数据库没有连接上则不需要验证 if (!AppConfigInfos.AppStateInfos.DataBaseState.Equals("1")) { LoginWindow loginWindow = WindowsHelper.ShowDialogWindow <LoginWindow>(this, PermissionConfig.AppClose, "0"); if (loginWindow.MessageBoxResult != MessageBoxResult.OK) { e.Cancel = true; return; } else { MainMessage.Instance.SendOperationLog("CollectAppExit"); } } else { MessageBoxResult result = NewMessageBox.Show(TryFindResource("appMainExitApp").ToString(), MessageBoxButton.OKCancel, this); if (result != MessageBoxResult.OK) { e.Cancel = true; return; } } WarnInfo.WarnHelper.Instance.ReceiveDataHandler -= Instance_ReceiveDataHandler; ModuleDispather.Instance.Dispose(); LogHelper.Instance.Dispose(); AppHelper.CloseKey(); App.Current.Shutdown(); }
private void btnCollectUp_Click(object sender, RoutedEventArgs e) { string logIds = string.Empty; foreach (CollectLogInfo mi in ManageViewModel.CollectLogs) { if (mi.IsChecked && mi.UpLoadState != "2") { logIds += mi.LogID + ","; } } if (string.IsNullOrEmpty(logIds)) { NewMessageBox.Show(TryFindResource("LogsControlBtnCollectUploadEmpty").ToString()); return; } LoginWindow loginWindow = WindowsHelper.ShowDialogWindow <LoginWindow>(ModelResponsible.Instance.ParentWindow, PermissionConfig.DataSearchModuleUpload, "0"); if (loginWindow.MessageBoxResult == MessageBoxResult.OK) { SearchManager.GetInstance().UploadCollectLog(logIds); SearchManager.GetInstance().SendOperationLog("CollectLogBulkUpload"); LogHelper.Instance.WirteLog(string.Format("LogsControl: UserCode:{0} btnCollectUp Upload logIds:{1}", AppConfigInfos.CurrentUserInfos.UserCode, logIds), LogLevel.LogDebug); } }
/// <summary> /// 取消配对 /// </summary> /// <param name="deviceCode"></param> private void CancelMatch(string deviceCode, string deviceID) { Conditions con = new Conditions(); con.AddItem("DeviceID", deviceID); con.AddItem("DeviceCode", deviceCode); // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.DeviceCancelPair, MsgType.DeviceCancelPairResult, con, TryFindResource("GatherCancelPairing").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("GatherCancelPairOverTime").ToString(); } else if (msgBoxResult == MessageBoxResult.Yes) { NewMessageBox.Show(TryFindResource("GatherCancelPairSuccess").ToString(), this); tbMsg.Text = string.Empty; btnCanelMatch.Visibility = Visibility.Hidden; } else if (msgBoxResult == MessageBoxResult.No) { DevicePairInfo devicePairInfo = resultWindow.ResultValue as DevicePairInfo; if (devicePairInfo.ResultCode == 2) { NewMessageBox.Show(TryFindResource("GatherCancelPairFail").ToString(), this); } else { NewMessageBox.Show(TryFindResource("GatherCancelPairFailed").ToString(), this); } } }
/// <summary> /// 确定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSure_Click(object sender, RoutedEventArgs e) { if (!isChangedValue && !firstChanged) { this.Close(); return; } if (!AppHelper.CheckAppState(this)) { return; } if (firstChanged) { // 设置优先端口 string portIndex = (cbFirst.SelectedValue ?? string.Empty).ToString(); string portCode = string.Empty; PortPairInfo portPairInfo = AppConfigInfos.PortPairInfos.Find(p => p.Index.Equals(portIndex)); if (portPairInfo != null) { portCode = portPairInfo.PortCode.Equals("----") ? string.Empty : portPairInfo.PortCode; } Conditions con = new Conditions(); con.AddItem("PortCode", portCode); con.AddItem("Respond", "0"); // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.SetFirstPortRequest, MsgType.SetFirstPortRespond, con, TryFindResource("appMainSetFirstPorting").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(TryFindResource("appMainSetPortOvertime").ToString(), this); return; } else if (msgBoxResult == MessageBoxResult.Yes) { AppConfigInfos.PortDeviceList.FirstPort = portIndex; AppConfigInfos.PortDeviceList.FirstPortCode = portCode; AppConfigHelper.SaveFirstPort(); } else if (msgBoxResult == MessageBoxResult.No) { NewMessageBox.Show(TryFindResource("appMainSetPortFailed").ToString(), this); return; } } if (isChangedValue) { AppConfigHelper.SavePortPairInfos(); } AppConfigInfos.PortDeviceList.IsChanged = !AppConfigInfos.PortDeviceList.IsChanged; this.Close(); }
/// <summary> /// 电子证据明细 /// </summary> /// <param name="mls"></param> public void SearchMediaLogDetail(MediaLogsSerach mls, bool showWindow = true) { if (!AppHelper.CheckAppState(ModelResponsible.Instance.ParentWindow)) { return; } string UserGuid = string.Empty; string OrgID = string.Empty; if (AppConfigInfos.CurrentUserInfos.UserType == "1") { if (mls.IsAdvanced) { UserGuid = mls.UserGuid; OrgID = string.IsNullOrEmpty(mls.OrgID) ? AppConfigInfos.LimitsUserInfos.OrgIDCodeStr : mls.OrgID; } else { OrgID = AppConfigInfos.LimitsUserInfos.OrgIDCodeStr; } } else { UserGuid = AppConfigInfos.CurrentUserInfos.UserGuid; OrgID = AppConfigInfos.CurrentUserInfos.OrgID; } Conditions cons = new Conditions(); cons.AddItem("UserGuid", UserGuid); cons.AddItem("OrgID", OrgID); cons.AddItem("FileName", mls.IsAdvanced ? mls.FileName : ""); cons.AddItem("DeviceID", mls.IsAdvanced ? mls.DeviceID : ""); cons.AddItem("FileType", mls.FileType); cons.AddItem("UserImp", mls.IsAdvanced ? mls.UserImp : "0"); cons.AddItem("UserTag", mls.IsAdvanced ? mls.UserTag : ""); cons.AddItem("UpLoadState", mls.IsAdvanced ? mls.UploadState : ""); cons.AddItem("SearchTime", mls.SearchTime); cons.AddItem("CollectStartTime", mls.CollectStartTime); cons.AddItem("CollectEndTime", mls.CollectEndTime); cons.AddItem("PageIndex", mls.PageIndex.ToString()); cons.AddItem("PageCount", mls.PageCount.ToString()); if (showWindow) { ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(null, MsgType.MediaLogRequest, MsgType.MediaLogRespond, cons, Application.Current.FindResource("SearchManagerSearch").ToString(), AppConfigInfos.AppStateInfos.SearchTimeOut); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(Application.Current.FindResource("SearchManagerSearchFail").ToString()); } } else { ModelResponsible.Instance.SendMessage(MsgType.MediaLogRequest, cons); } }
/// <summary> /// 验证权限 /// </summary> /// <param name="permissionValue"></param> /// <returns></returns> private bool LoginValidate(string permissionValue) { LoginWindow loginWindow = WindowsHelper.ShowDialogWindow <LoginWindow>(ModelResponsible.Instance.ParentWindow, permissionValue, "0"); if (loginWindow.MessageBoxResult != MessageBoxResult.OK) { NewMessageBox.Show(TryFindResource("FingerNoPower").ToString(), ModelResponsible.Instance.ParentWindow); return(true); } return(false); }
/// <summary> /// 正常警员配对 /// </summary> private void MatchDeviceByNormalPolice(string forceMatch = "0") { // 普通警员:先判断是否此设备和自己配对,如果是则弹出配对窗口,里面只有自己可以选择,否则提示不能操作 if (deviveInfo.IsMatchOrRegist == Model.IsMatchOrRegist.Matched) { EditorMatchByNormal(); } else { Conditions con = new Conditions(); con.AddItem("UserID", AppConfigInfos.LimitsUserInfos.UserID); con.AddItem("DeviceID", deviveInfo.DeviceCode); con.AddItem("UserName", AppConfigInfos.CurrentUserInfos.UserName); con.AddItem("UserCode", AppConfigInfos.CurrentUserInfos.UserCode); con.AddItem("OrgID", AppConfigInfos.CurrentUserInfos.OrgID); con.AddItem("OrgName", AppConfigInfos.CurrentUserInfos.OrgName); con.AddItem("ForceMatch", forceMatch); // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(parentWindow, MsgType.DevicePair, MsgType.DevicePairResult, con, TryFindResource("GatherPairing").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(TryFindResource("GatherPairOverTime").ToString(), parentWindow); } else if (msgBoxResult == MessageBoxResult.Yes) { NewMessageBox.Show(TryFindResource("GatherPairSuccess").ToString(), parentWindow); ModelResponsible.Instance.SendOperationLog("CollectDevicePair"); } else if (msgBoxResult == MessageBoxResult.No) { DevicePairInfo devicePairInfo = resultWindow.ResultValue as DevicePairInfo; if (devicePairInfo.ResultCode == 2) { // 已配对 MessageBoxResult messageBoxResult = NewMessageBox.Show(string.Format(TryFindResource("GatherAlreadyPair").ToString(), devicePairInfo.ResultMsg), MessageBoxButton.YesNo, parentWindow); if (messageBoxResult == MessageBoxResult.Yes) { MatchDeviceByNormalPolice("1"); } } else { string msg = (TryFindResource("GatherPairCode_" + devicePairInfo.ResultCode) ?? string.Empty).ToString(); msg = string.IsNullOrEmpty(msg) ? TryFindResource("GatherPairCode_-1").ToString() : msg; NewMessageBox.Show(msg, parentWindow); } } } }
static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new ConnectDatabaseForm()); } catch (Exception ex) { NewMessageBox newMessagebox = new NewMessageBox(); newMessagebox.error(ex.ToString()); } }
/// <summary> /// 注册 /// </summary> private void RgisterDevice() { LoginWindow loginWindow = WindowsHelper.ShowDialogWindow <LoginWindow>(parentWindow, PermissionConfig.DeviceRegister, "0"); if (loginWindow.MessageBoxResult == MessageBoxResult.OK) { DeviveInfo selectDevice = GatherViewModel.DeviveInfoList.Find(p => p.DeviceCode.Equals(deviveInfo.DeviceCode)); if (selectDevice == null) { NewMessageBox.Show(string.Format(TryFindResource("GatherDeviceRemove").ToString(), deviveInfo.DeviceCode)); return; } WindowsHelper.ShowDialogWindow <DeviceRegisterWindow>(parentWindow, deviveInfo); } }
/// <summary> /// 开始采集 /// </summary> private void CollectOpertion(string permissionID, string disContent, string overTimeMsg, MsgType sendMsgType, MsgType receiveMsgType, string failedMsg) { LoginWindow loginWindow = WindowsHelper.ShowDialogWindow <LoginWindow>(parentWindow, permissionID, "1"); if (loginWindow.MessageBoxResult != MessageBoxResult.OK) { return; } // 防止执法记录仪在验证过程中拔掉 DeviveInfo selectDevice = GatherViewModel.DeviveInfoList.Find(p => p.DeviceCode.Equals(deviveInfo.DeviceCode)); if (selectDevice == null) { NewMessageBox.Show(string.Format(TryFindResource("GatherDeviceRemove").ToString(), deviveInfo.DeviceCode), parentWindow); return; } if (AppConfigInfos.LimitsUserInfos.UserType == "1") { WindowsHelper.ShowDialogWindow <HandCollectWindow>(parentWindow, deviveInfo); } else { Conditions con = new Conditions(); con.AddItem("DeviceID", deviveInfo.DeviceCode); con.AddItem("UserID", AppConfigInfos.LimitsUserInfos.UserID); ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(parentWindow, sendMsgType, receiveMsgType, con, disContent); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(overTimeMsg, parentWindow); } else if (msgBoxResult == MessageBoxResult.No) { NewMessageBox.Show(failedMsg, parentWindow); } else { // 操作日志 string code = "CollectHandGather"; ModelResponsible.Instance.SendOperationLog(code); } } }
void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { NewPhysicsCode = (comboBox.SelectedValue ?? string.Empty).ToString(); PortPairInfo portPairInfo; if (!NewPhysicsCode.Equals("-----")) { portPairInfo = AppConfigInfos.PortPairInfos.Find(p => p.PortCode.Equals(NewPhysicsCode) && !p.Index.Equals(InventedIndex.ToString())); if (portPairInfo != null) { int countPort = AppConfigInfos.AppStateInfos.FaceplateColumn * AppConfigInfos.AppStateInfos.FaceplateRow; // 只提示在面板中有显示的端口占用情况 if (Convert.ToInt32(portPairInfo.Index) <= countPort) { comboBox.SelectionChanged -= comboBox_SelectionChanged; comboBox.SelectedValue = lastOldValue; comboBox.SelectionChanged += comboBox_SelectionChanged; NewMessageBox.Show(string.Format(TryFindResource("GatherPortRePair").ToString(), portPairInfo.Index)); return; } else { portPairInfo.PortCode = lastOldValue; } } } portPairInfo = AppConfigInfos.PortPairInfos.Find(p => p.Index.Equals(InventedIndex.ToString())); if (portPairInfo == null) { AppConfigInfos.PortPairInfos.Add(new PortPairInfo() { Index = InventedIndex.ToString(), PortCode = NewPhysicsCode }); } else { portPairInfo.PortCode = NewPhysicsCode; } if (ChangeValueHandler != null) { ChangeValueHandler(this, NewPhysicsCode); } }
/// <summary> /// 窗口关闭时,判断指纹采集情况 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (FingerStatus == FingerStatus.RecordSuccess) { MessageBoxResult messageBoxResult = NewMessageBox.Show(TryFindResource("FingerCloseSaveWindow").ToString(), MessageBoxButton.YesNo, this); if (messageBoxResult != MessageBoxResult.Yes) { e.Cancel = true; return; } } Conditions con = new Conditions(); con.AddItem("UserID", CurrentUser.UserID); ModelResponsible.Instance.SendMessage(MsgType.FingerStopRequest, con); }
/// <summary> /// 启动键盘 /// </summary> public static void StartKey(Window Owner) { string filePath = AppDomain.CurrentDomain.BaseDirectory + "Write.exe"; if (File.Exists(filePath)) { Process p = new Process(); p.StartInfo.FileName = filePath; p.StartInfo.UseShellExecute = false; p.Start(); p.Close(); } else { NewMessageBox.Show(Owner.TryFindResource("appMainKeyFileNoFound").ToString()); } }
private void CheckStartTimeEvent(string startTimestr) { if (DateTime.Parse(endTime.txtDate.Text) < DateTime.Parse(startTimestr)) { NewMessageBox.Show(TryFindResource("SearchBarControlCheckStartTime").ToString()); return; } SearchManager.GetInstance().MediaLogsSerach.CollectStartTime = startTimestr; SearchManager.GetInstance().CollectLogsSerach.CollectStartTime = startTimestr; SearchManager.GetInstance().CameraLogsSerach.CollectStartTime = startTimestr; SearchManager.GetInstance().AlarmLogsSearch.AlarmStartTime = startTimestr; startTime.txtDate.Text = startTimestr; }
private void AnalyzeMediaLogEditor(string value) { MediaLogEditorResult mer = XmlUnityConvert.XmlDeserialize <MediaLogEditorResult>(value); if (mer != null && mer.ResultCode == "0") { MediaInfo mediaInfo = ManageViewModel.MediaList.Find(p => p.RecordID.Equals(mer.MediaLogID)); if (mediaInfo != null) { mediaInfo.UserImp = mediaInfo.UpdateUserImp; mediaInfo.UserTag = mediaInfo.UpdateMark; } MediaInfo mediaVoiceInfo = ManageViewModel.VoicePlayMediaList.Find(p => p.RecordID.Equals(mer.MediaLogID)); if (mediaVoiceInfo != null) { mediaVoiceInfo.UserImp = mediaVoiceInfo.UpdateUserImp; mediaVoiceInfo.UserTag = mediaVoiceInfo.UpdateMark; } MediaInfo mediaPicInfo = ManageViewModel.PicturePlayMediaList.Find(p => p.RecordID.Equals(mer.MediaLogID)); if (mediaPicInfo != null) { mediaPicInfo.UserImp = mediaPicInfo.UpdateUserImp; mediaPicInfo.UserTag = mediaPicInfo.UpdateMark; } MediaInfo mediaVideoInfo = ManageViewModel.VideoPlayMediaList.Find(p => p.RecordID.Equals(mer.MediaLogID)); if (mediaVideoInfo != null) { mediaVideoInfo.UserImp = mediaVideoInfo.UpdateUserImp; mediaVideoInfo.UserTag = mediaVideoInfo.UpdateMark; } ResultWindow resultWindow = CheckResultMsg(MsgType.MediaLogEditorRespond); if (resultWindow != null) { resultWindow.SuccessCloseWindow(); } } else { NewMessageBox.Show(Application.Current.FindResource("SearchManagerSaveTimeOut").ToString()); } }
private void btnPlay_Click(object sender, RoutedEventArgs e) { var btn = sender as Button; MediaInfo mi = btn.DataContext as MediaInfo; if (mi != null) { string filepath = mi.FilePath + mi.FileName; if (!System.IO.File.Exists(filepath)) { NewMessageBox.Show(TryFindResource("SearchManagerPlayFileNoData").ToString()); return; } WindowsHelper.GetOrNewWindow <PlayWindow>(true).UpdateSelectTab(mi); WindowsHelper.ShowDialogWindow <PlayWindow>(ModelResponsible.Instance.ParentWindow); LogHelper.Instance.WirteLog(string.Format("PlayHisListControl: UserCode:{0} btnPlay RecordID:{1}", AppConfigInfos.CurrentUserInfos.UserCode, mi.RecordID), LogLevel.LogDebug); } }
/// <summary> /// 普通警员不能编辑其他用户的设备,编辑自己的配对页面只能选择自己的信息 /// </summary> private void EditorMatchByNormal() { if (deviveInfo.MatchUserID.Equals(AppConfigInfos.LimitsUserInfos.UserID)) { AppConfigInfos.LimitsUserInfos.Users.UserList.Clear(); UserInfos myInfo = new UserInfos() { UserGuid = AppConfigInfos.LimitsUserInfos.UserGuid, UserID = AppConfigInfos.LimitsUserInfos.UserID, UserName = AppConfigInfos.LimitsUserInfos.UserName, UserCode = AppConfigInfos.LimitsUserInfos.UserCode }; AppConfigInfos.LimitsUserInfos.Users.UserList.Add(myInfo); WindowsHelper.ShowDialogWindow <MatchWindow>(parentWindow, deviveInfo); } else { NewMessageBox.Show(TryFindResource("GatherPairNotPow").ToString(), parentWindow); } }
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (isClose) { return; } string delValue = string.Empty; string editorValue = string.Empty; List <Finger> newFingers = GetNewFinger(); GetChangeValue(ref delValue, ref editorValue, userInfo.Fingers, newFingers); if (!string.IsNullOrEmpty(delValue) || !string.IsNullOrEmpty(editorValue)) { MessageBoxResult messageBoxResult = NewMessageBox.Show(TryFindResource("FingerCloseEditorWindow").ToString(), MessageBoxButton.YesNo, this); if (messageBoxResult != MessageBoxResult.Yes) { e.Cancel = true; } } }
/// <summary> /// 点击确定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnStart_Click(object sender, RoutedEventArgs e) { tbMsg.Text = string.Empty; if (FingerStatus == FingerStatus.RecordSuccess) { Conditions con = new Conditions(); con.AddItem("UserID", CurrentUser.UserID); con.AddItem("FingerName", btnEditor.Text); con.AddItem("FingerImage", FingerImage); // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.FingerSaveRequest, MsgType.FingerSaveRespond, con, TryFindResource("FingerSaveData").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("FingerSaveOverTime").ToString(); } else if (msgBoxResult == MessageBoxResult.Yes) { ModelResponsible.Instance.SendOperationLog("CollectFingerGather"); FingerStatus = FingerStatus.Finish; this.Close(); NewMessageBox.ShowTip(TryFindResource("FingerSaveSuccess").ToString(), ModelResponsible.Instance.ParentWindow); } else if (msgBoxResult == MessageBoxResult.No) { FingerResult fingerResult = resultWindow.ResultValue as FingerResult; tbMsg.Text = (TryFindResource("FingerCollectCode_" + fingerResult.ResultCode) ?? string.Empty).ToString(); } } else if (FingerStatus == FingerStatus.RecordFail) { SendStartCollectFinger(); FingerStatus = FingerStatus.Recording; } }
/// <summary> /// 更新数据 /// </summary> /// <param name="dataRefreshResult"></param> public void UpdateProgress(DataRefreshResult dataRefreshResult) { pbData.Tag = (dataRefreshResult.DataCode == ResultCode.Success).ToString(); if (dataRefreshResult.DataCode == ResultCode.Success) { pbData.Value = Convert.ToDouble(dataRefreshResult.ProgressValue); } else { string errorMsg = (TryFindResource("appMainRefreshResultCode_" + dataRefreshResult.ResultMsg) ?? string.Empty).ToString(); errorMsg = string.IsNullOrEmpty(errorMsg) ? TryFindResource("appMainRefreshResultCode_0").ToString() : errorMsg; tbResult.Text = errorMsg; windowHead.IsEnabled = true; } tbMsg.Text = msgList.ContainsKey(dataRefreshResult.ResultMsg) ? msgList[dataRefreshResult.ResultMsg] : tbMsg.Text; if (Convert.ToInt32(dataRefreshResult.ProgressValue) == 100) { this.Close(); MainMessage.Instance.SendCommand(Model.MsgType.DeviceInfosRequest); NewMessageBox.Show(TryFindResource("appMainRefreshFinish").ToString(), parentWindow); } }
/// <summary> /// 保存编辑后的电子证据信息 /// </summary> /// <param name="cls"></param> public void SaveMediaInfo(MediaInfo cls) { if (!AppHelper.CheckAppState(ModelResponsible.Instance.ParentWindow)) { return; } Conditions cons = new Conditions(); cons.AddItem("MediaLogID", cls.RecordID); cons.AddItem("UserImp", cls.UpdateUserImp); cons.AddItem("UserID", cls.UserID); cons.AddItem("UserName", cls.UserName); cons.AddItem("OrgName", cls.OrgName); cons.AddItem("DateTime", cls.RecordTime); cons.AddItem("Mark", cls.UpdateMark); ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(null, MsgType.MediaLogEditorRequest, MsgType.MediaLogEditorRespond, cons, Application.Current.FindResource("SearchManagerSave").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(Application.Current.FindResource("SearchManagerSaveTimeOut").ToString()); } }
/// <summary> /// 检查App状态 /// </summary> /// <param name="Owner"></param> /// <returns></returns> public static bool CheckAppState(Window Owner) { if (!AppConfigInfos.IceConnect) { NewMessageBox.Show(Owner.TryFindResource("appMainDataConnect").ToString(), Owner); return(false); } //修改比较顺序,AppConfigInfos.AppStateInfos.DataBaseState可能为空 if ("1".Equals(AppConfigInfos.AppStateInfos.DataBaseState)) { NewMessageBox.Show(Owner.TryFindResource("appMainDataBaseFailed").ToString(), Owner); return(false); } //if (AppConfigInfos.AppStateInfos.ServerState.Equals("1")) //{ // NewMessageBox.Show("采集站与后台管理中心连接失败,请检查参数配置!", Owner); // return false; //} return(true); }
/// <summary> /// 数据同步刷新 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRefresh_Click(object sender, RoutedEventArgs e) { if (!AppHelper.CheckAppState(this)) { return; } // 发送数据同步 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.DataRefreshRequest, MsgType.DataRefreshRespond, TryFindResource("appMainSendDataRefresh").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { NewMessageBox.Show(TryFindResource("appMainDataRefreshOverTime").ToString()); } else if (msgBoxResult == MessageBoxResult.Yes) { WindowsHelper.ShowDialogWindow <RefershWindow>(this, this); } else { NewMessageBox.Show(TryFindResource("appMainDataRefreshFailed").ToString()); } }