/// <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="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); } } }
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="sender"></param> /// <param name="e"></param> private void btnCollect_Click(object sender, RoutedEventArgs e) { tbMsg.Text = string.Empty; if (string.IsNullOrEmpty(autoCmb.SelectValue)) { tbMsg.Text = TryFindResource("GatherCollectInfo").ToString(); return; } Conditions con = new Conditions(); con.AddItem("DeviceID", DeviveInfo.DeviceCode); con.AddItem("UserID", autoCmb.SelectValue); ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.DeviceHandCollect, MsgType.DeviceHandCollectResult, con, TryFindResource("GatherCollecting").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("GatherCollectOvertime").ToString(); } else if (msgBoxResult == MessageBoxResult.No) { tbMsg.Text = TryFindResource("GatherCollectFailed").ToString(); } else { // 操作日志 string code = "CollectHandGather"; ModelResponsible.Instance.SendOperationLog(code); this.Close(); } }
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(); } }
/// <summary> /// 发送指纹验证请求 /// </summary> private void SendFingerValidate() { Conditions cons = new Conditions(); cons.AddItem("PermissionID", PermissionID); cons.AddItem("IsUserInfo", "1"); cons.AddItem("IsLimitsInfo", IsLimitsInfo); Responsible.SendMsg(MsgType.FingerprintValidate, cons); }
/// <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="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); } }
public void SendOperationLog(string operateCode, MediaInfo mi = null) { Conditions cons = null; if (mi != null) { cons = new Conditions(); cons.AddItem("OperatedID", mi.RecordID); cons.AddItem("OperatedName", mi.FileName); cons.AddItem("OperatedCode", mi.DeviceID); cons.AddItem("OperatedOrgID", mi.OrgID); cons.AddItem("OperatedOrgName", mi.OrgName); } ModelResponsible.Instance.SendOperationLog(operateCode, cons); }
/// <summary> /// 发送心跳包 /// </summary> public void SendHeartbeat() { Conditions con = new Conditions(); con.AddItem("ClientID", IceHelper.Instance.ClientID); AddMsg(MsgType.Heartbeat, con); }
/// <summary> /// 发送采集指纹命令 /// </summary> private void SendStartCollectFinger() { Conditions con = new Conditions(); con.AddItem("UserID", CurrentUser.UserID); ModelResponsible.Instance.SendMessage(MsgType.FingerStartRequest, con); }
/// <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); } } }
/// <summary> /// 执法仪日志明细 /// </summary> /// <param name="cls"></param> public void SearchCameraLogDetail(CameraLogsSerach cls, bool showWindow = true) { if (!AppHelper.CheckAppState(ModelResponsible.Instance.ParentWindow)) { return; } string UserGuid = string.Empty; string OrgID = string.Empty; if (AppConfigInfos.CurrentUserInfos.UserType == "1") { if (cls.IsAdvanced) { UserGuid = cls.UserGuid; OrgID = string.IsNullOrEmpty(cls.OrgID) ? AppConfigInfos.LimitsUserInfos.OrgIDCodeStr : cls.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("DeviceID", cls.IsAdvanced ? cls.DeviceID : ""); cons.AddItem("LogType", cls.LogType); cons.AddItem("UpLoadState", cls.IsAdvanced ? cls.UploadState : ""); cons.AddItem("CollectStartTime", cls.CollectStartTime); cons.AddItem("CollectEndTime", cls.SearchTime); cons.AddItem("PageIndex", cls.PageIndex.ToString()); cons.AddItem("PageCount", cls.PageCount.ToString()); if (showWindow) { ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(null, MsgType.LogContentRequest, MsgType.CameraLogRespond, 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.LogContentRequest, cons); } }
protected override void OnConnectNetWorkNotic(DataResponsible responsible) { // 获取执法记录仪信息列表 responsible.SendCommand(Model.MsgType.DeviceInfosRequest); responsible.SendCommand(Model.MsgType.PcStateRequest); responsible.SendCommand(Model.MsgType.PortInfosRequest); responsible.SendCommand(Model.MsgType.LicenseRequest); // 设置优先端口 if (!string.IsNullOrEmpty(AppConfigInfos.PortDeviceList.FirstPortCode)) { Conditions con = new Conditions(); con.AddItem("PortCode", AppConfigInfos.PortDeviceList.FirstPortCode.Equals("----") ? string.Empty : AppConfigInfos.PortDeviceList.FirstPortCode); con.AddItem("Respond", "1"); MainMessage.Instance.SendMessage(Model.MsgType.SetFirstPortRequest, con); } }
/// <summary> /// 采集站日志上传 /// </summary> /// <param name="logIDs"></param> public void UploadCollectLog(string logIDs) { if (!AppHelper.CheckAppState(ModelResponsible.Instance.ParentWindow)) { return; } Conditions cons = new Conditions(); cons.AddItem("LogIDs", logIDs); ModelResponsible.Instance.SendMessage(MsgType.CollectLogUploadRequest, cons); }
/// <summary> /// 查询回放 /// </summary> private void DataSearch() { LoginWindow loginWindow = WindowsHelper.ShowDialogWindow <LoginWindow>(parentWindow, PermissionConfig.DataSearchMoudle, "1"); if (loginWindow.MessageBoxResult == MessageBoxResult.OK) { Conditions con = new Conditions(); con.AddItem("DeviceID", deviveInfo.DeviceCode); ModelResponsible.Instance.SendMsgToSelf(AppSelfMsgType.DataSearchPlay, JsonUnityConvert.SerializeObject(con)); } }
/// <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="sender"></param> /// <param name="e"></param> private void btnLogin_Click(object sender, RoutedEventArgs e) { if (!CheckConditions()) { return; } Conditions cons = new Conditions(); cons.AddItem("UserName", tbName.Text); cons.AddItem("Password", tbPassword.Text); cons.AddItem("PermissionID", PermissionID); cons.AddItem("IsUserInfo", "1"); cons.AddItem("IsLimitsInfo", IsLimitsInfo); tbMsg.Text = string.Empty; ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.AccountValidate, MsgType.AccountValidateResult, cons, TryFindResource("appValidating").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; UserResult userResult = resultWindow.ResultValue as UserResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("appLoginCode_5").ToString(); } else if (msgBoxResult == System.Windows.MessageBoxResult.Yes) { SaveLoginUserInfo(userResult); MessageBoxResult = MessageBoxResult.OK; this.Close(); } else if (msgBoxResult == System.Windows.MessageBoxResult.No) { string msg = string.Empty; msg = (TryFindResource("appLoginCode_" + userResult.UserResultCode) ?? "Undefine Error").ToString(); tbMsg.Text = msg; } }
/// <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); } } } }
/// <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> /// <param name="cls"></param> public void SearchCameraLogCount(CameraLogsSerach cls) { string UserGuid = string.Empty; string OrgID = string.Empty; if (AppConfigInfos.CurrentUserInfos.UserType == "1") { if (cls.IsAdvanced) { UserGuid = cls.UserGuid; OrgID = string.IsNullOrEmpty(cls.OrgID) ? AppConfigInfos.LimitsUserInfos.OrgIDCodeStr : cls.OrgID; } else { OrgID = AppConfigInfos.LimitsUserInfos.OrgIDCodeStr; } } else { UserGuid = AppConfigInfos.CurrentUserInfos.UserGuid; OrgID = AppConfigInfos.CurrentUserInfos.OrgID; } if (DateTime.Compare(Convert.ToDateTime(cls.CollectEndTime), DateTime.Now) > 0) { SearchManager.GetInstance().CameraLogsSerach.SearchTime = DateTime.Now.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"); } else { SearchManager.GetInstance().CameraLogsSerach.SearchTime = cls.CollectEndTime; } Conditions cons = new Conditions(); cons.AddItem("UserGuid", UserGuid); cons.AddItem("OrgID", OrgID); cons.AddItem("DeviceID", cls.IsAdvanced ? cls.DeviceID : ""); cons.AddItem("LogType", cls.LogType); cons.AddItem("UpLoadState", cls.IsAdvanced ? cls.UploadState : ""); cons.AddItem("CollectStartTime", cls.CollectStartTime); cons.AddItem("CollectEndTime", cls.SearchTime); ModelResponsible.Instance.SendMessage(MsgType.LogCountRequest, cons); }
/// <summary> /// 告警总数 /// </summary> /// <param name="als"></param> public void SearchAlarmLogCount(AlarmLogsSearch als) { if (DateTime.Compare(Convert.ToDateTime(als.AlarmtEndTime), DateTime.Now) > 0) { SearchManager.GetInstance().AlarmLogsSearch.SearchTime = DateTime.Now.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"); } else { SearchManager.GetInstance().AlarmLogsSearch.SearchTime = als.AlarmtEndTime; } 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,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); ModelResponsible.Instance.SendMessage(MsgType.AlarmCountRequest, cons); }
/// <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> /// 线程加载数据 /// </summary> private void LoadData() { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); PrintMsg("appMainLoadConfig", "20%"); LogHelper.Instance.Init(); PrintMsg("appMainInitModule", "40%"); // 模块初始化 ModuleDispather.Instance.Init(); WarnInfo.WarnHelper.Instance.Init(); if (!AppConfigInfos.IceConnect) { Application.Current.Dispatcher.Invoke(new Action(() => { NewMessageBox.Show(TryFindResource("appMainDataConnect").ToString(), this); App.Current.Shutdown(); })); return; } // 采集端口信息 MainMessage.Instance.SendCommand(Model.MsgType.PortInfosRequest); // license信息 MainMessage.Instance.SendCommand(Model.MsgType.LicenseRequest); PrintMsg("appMainLoadPcInfo", "60%"); // 设置优先端口 if (!string.IsNullOrEmpty(AppConfigInfos.PortDeviceList.FirstPortCode)) { Conditions con = new Conditions(); con.AddItem("PortCode", AppConfigInfos.PortDeviceList.FirstPortCode.Equals("----") ? string.Empty : AppConfigInfos.PortDeviceList.FirstPortCode); con.AddItem("Respond", "1"); MainMessage.Instance.SendMessage(Model.MsgType.SetFirstPortRequest, con); } PrintMsg("appMainLoadDeviceInfo", "80%"); // 获取执法记录仪信息列表 MainMessage.Instance.SendCommand(Model.MsgType.DeviceInfosRequest); PrintMsg("appMainLoadPersonInfo", "100%"); stopwatch.Stop(); if (stopwatch.ElapsedMilliseconds < 5000) { Thread.Sleep((int)(5000 - stopwatch.ElapsedMilliseconds)); } this.Dispatcher.BeginInvoke(new Action(() => { isClosed = true; this.Close(); WindowsHelper.ShowWindow <MainWindow>(); })); }
/// <summary> /// 配对 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnMatch_Click(object sender, RoutedEventArgs e) { tbMsg.Text = string.Empty; btnCanelMatch.Visibility = Visibility.Hidden; if ((DeviveInfo.IsMatchOrRegist == IsMatchOrRegist.Registered && string.IsNullOrEmpty(autoCmb.SelectValue)) || (DeviveInfo.IsMatchOrRegist == IsMatchOrRegist.Matched && !string.IsNullOrEmpty(autoCmb.Text) && string.IsNullOrEmpty(autoCmb.SelectValue))) { tbMsg.Text = TryFindResource("GatherPairInfoError").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; } if (DeviveInfo.IsMatchOrRegist == IsMatchOrRegist.Matched && DeviveInfo.MatchUserID.Equals(autoCmb.SelectValue)) { NewMessageBox.Show(TryFindResource("GatherPairInfoNoChange").ToString()); // 编辑配对如果用户没有选择其他用户点击配置,则直接结束 this.Close(); return; } Conditions con = new Conditions(); if (!string.IsNullOrEmpty(autoCmb.SelectValue)) { // 配对 UserInfos matchUserInfo = AppConfigInfos.LimitsUserInfos.Users.UserList.Find(p => p.UserID.Equals(autoCmb.SelectValue)); con.AddItem("UserID", autoCmb.SelectValue); con.AddItem("DeviceID", DeviveInfo.DeviceCode); con.AddItem("UserName", matchUserInfo == null ? string.Empty : matchUserInfo.UserName); con.AddItem("UserCode", matchUserInfo == null ? string.Empty : matchUserInfo.UserCode); con.AddItem("OrgID", matchUserInfo == null ? string.Empty : matchUserInfo.OrgID); con.AddItem("OrgName", matchUserInfo == null ? string.Empty : matchUserInfo.OrgName); con.AddItem("ForceMatch", "0"); // 调度员没有取消后再配对协议 } else { // 选择为空的则为取消配对 CancelMatch(DeviveInfo.DeviceCode, (DeviveInfo.DeviceID ?? string.Empty).ToString()); this.Close(); return; } // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.DevicePair, MsgType.DevicePairResult, con, TryFindResource("GatherPairing").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("GatherPairOverTime").ToString(); } else if (msgBoxResult == MessageBoxResult.Yes) { if (isPair) { ModelResponsible.Instance.SendOperationLog("CollectDevicePair"); } else { ModelResponsible.Instance.SendOperationLog("CollectDeviceEditor"); } this.Close(); } else if (msgBoxResult == MessageBoxResult.No) { DevicePairInfo devicePairInfo = resultWindow.ResultValue as DevicePairInfo; if (devicePairInfo.ResultCode == 2) { // 已配对 tbMsg.Text = string.Format(TryFindResource("GatherPairMarkStart").ToString(), devicePairInfo.ResultMsg); btnCanelMatch.Visibility = Visibility.Visible; btnCanelMatch.Tag = devicePairInfo.ResultMsg + "," + devicePairInfo.DeviceID; // 记录已配对DeviceCode } else { string msg = (TryFindResource("GatherPairCode_" + devicePairInfo.ResultCode) ?? string.Empty).ToString(); msg = string.IsNullOrEmpty(msg) ? TryFindResource("GatherPairCode_-1").ToString() : msg; tbMsg.Text = msg; } } }
/// <summary> /// 电子证据总数 /// </summary> /// <param name="mls"></param> public void SearchMediaLogCount(MediaLogsSerach mls) { 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", "0"); 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); ModelResponsible.Instance.SendMessage(MsgType.MediaLogCountRequest, cons); }