private void btnOK_Click(object sender, EventArgs e) { string text = this.txtAdmin.Text; string inPass = this.txtPw.Text; if (text.Length <= 0) { MessageBox.Show("请输入管理员ID"); } else if (inPass.Length <= 0) { MessageBox.Show("请输入管理员口令"); } else if (!RemotingClient.LoginSys_CheckUser(text, inPass)) { MessageBox.Show("你没有权限操作"); } else { base.DialogResult = DialogResult.OK; } }
private void btnDelRegion_Click(object sender, EventArgs e) { string text = this.cmbRegion.Text; if (text == m_sRegionKong) { MessageBox.Show("没有区域"); } else if (MessageBox.Show(string.Format("您确认要删除区域{0}吗?", text), "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { if (!RemotingClient.Alarm_DelRegionCheckAuth(text)) { MessageBox.Show(string.Format("您无权限删除区域{0}!", text)); } else if (RemotingClient.Alarm_DelRegion(text) < 0) { MessageBox.Show("区域删除失败"); } else { DataTable dataSource = (DataTable)this.cmbRegion.DataSource; foreach (DataRow row in dataSource.Select(string.Format("RegionName='{0}'", text))) { dataSource.Rows.Remove(row); if (dataSource.Rows.Count > 0) { this.cmbRegion_SelectedIndexChanged(sender, e); } else { this.cmbRegion.DataSource = null; this.cmbRegion.Items.Clear(); this.cmbRegion.Items.Add(m_sRegionKong); this.cmbRegion.Text = m_sRegionKong; } } } } }
///<summary></summary> private static string RunWebMethod(Func <string> funcWebMethod) { Exception ex = null; //Create an ODThread so that we can safely change the database connection settings without affecting the calling method's connection. ODThread odThread = new ODThread(new ODThread.WorkerDelegate((ODThread o) => { //Change the thread static remoting role to ServerWeb and then execute the func that was passed in. RemotingClient.SetRemotingRoleT(RemotingRole.ServerWeb); o.Tag = funcWebMethod(); })); odThread.AddExceptionHandler(new ODThread.ExceptionDelegate((Exception e) => { ex = e; //Cannot throw exception here due to still being in a threaded context. })); if (ex != null) { throw ex; //Should never happen because this would be a "web exception" as in the ProcessRequest could not even invoke or something like that. } odThread.Name = "threadMiddleTierUnitTestRunWebMethod"; odThread.Start(true); odThread.Join(System.Threading.Timeout.Infinite); return((string)odThread.Tag); }
private void CreateComboBoxWithEnums() { this.AllRegion = RemotingClient.Alarm_GetRegionInfo(); DataGridViewComboBoxColumn column = this.dgvPostRoute.Columns["PointName"] as DataGridViewComboBoxColumn; column.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; Dictionary <string, string> dataSource = new Dictionary <string, string>(); foreach (DataRow row in this.AllRegion.Rows) { if (Check.isRectangle(row["RegionDot"].ToString())) { dataSource[row["regionName"].ToString()] = row["regionID"] + "◎"; } } if ((dataSource != null) && (dataSource.Count > 0)) { column.DataSource = new BindingSource(dataSource, null); column.DisplayMember = "Key"; column.ValueMember = "Value"; } }
private void InitData() { this.simNums = base.sCarSimNum.Split(new char[] { ',' }); string format = " select a.ID, a.SimNum, a.StartTime, a.EndTime, a.CrossDay, a.regionId, a.regionIndex, b.regionName from GpsCarInOutOfRangeTime a INNER JOIN GpsRegionType b on a.regionID = b.regionID where a.SimNum = '{0}' order by regionIndex "; DataTable table = RemotingClient.ExecSql(string.Format(format, this.simNums[0])); if ((table != null) && (table.Rows.Count > 0)) { foreach (DataRow row in table.Rows) { DataRow row2 = this.m_dtRegion.NewRow(); row2["PointIndex"] = row["regionIndex"]; row2["PointID"] = row["regionId"]; row2["PointName"] = row["regionName"]; row2["StartTime"] = Convert.ToDateTime(row["StartTime"]).ToString("HH:mm:ss"); row2["EndTime"] = Convert.ToDateTime(row["EndTime"]).ToString("HH:mm:ss"); row2["CrossDay"] = row["CrossDay"]; this.m_dtRegion.Rows.Add(row2); } } this.dgvPostRoute.DataSource = this.m_dtRegion; }
private void InitData() { this.InitDataSource(); int iRegionFeature = 0; DataTable table = RemotingClient.Car_GetRegionInfo(MainForm.myCarList.SelectedCarId, iRegionFeature); if (table != null) { for (int i = 0; i < table.Rows.Count; i++) { string str2 = table.Rows[i]["regionName"].ToString(); string str3 = table.Rows[i]["RegionId"].ToString(); string str4 = table.Rows[i]["RegionDot"].ToString(); DataRow row = this.m_dtRegion.NewRow(); row["colSel"] = false; row["regionName"] = str2; row["regionId"] = str3; row["regionDot"] = str4; this.m_dtRegion.Rows.Add(row); } } }
protected override void btnOK_Click(object sender, EventArgs e) { base.btnOK_Click(sender, e); if (!string.IsNullOrEmpty(base.sValue) && this.getParam()) { if (!string.IsNullOrEmpty(this.strSql)) { base.reResult = RemotingClient.ExecNoQuery(this.strSql); if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); return; } } if (!string.IsNullOrEmpty(this.sIntervalAll) && this.Interval.Visible) { foreach (string str in base.sCarId.Split(new char[] { ',' })) { int num2 = 1537; base.reResult = RemotingClient.ExecNoQuery(this.sIntervalAll.Replace("[A]", str).Replace("[B]", num2.ToString())); if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); return; } } } base.reResult = RemotingClient.icar_SetCommonCmdTraffic(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_SimpleCmd); if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); } else { base.DialogResult = DialogResult.OK; } } }
private void _worker_DoWork(object sender, DoWorkEventArgs e) { try { if (!string.IsNullOrEmpty(this.sSql)) { string[] strArray = base.sValue.Split(new char[] { ',' }); int length = strArray.Length; int num2 = 0; foreach (string str in strArray) { string CarNum = MainForm.myCarList.execChangeCarValue(this.ParamType, 0, str); string newValue = MainForm.myCarList.execChangeCarValue(this.ParamType, 2, str); base.reResult = RemotingClient.ExecNoQuery(this.sSql.Replace("[A]", newValue)); string orderResult = (base.reResult.ResultCode != 0L) ? "失败" : "成功"; string sGpsTime = RemotingClient.GetDBCurrentDateTime(); if (string.IsNullOrEmpty(sGpsTime)) { sGpsTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } string sOrderId = "0"; string orderType = "发送"; string orderName = "设置车辆按时到离站"; string sMsg = "设置车辆按时到离站-" + this.ParamList; sMsg = sMsg.Trim(new char[] { '-' }); //base.Invoke(() => MainForm.myLogForms.myNewLog.AddUserMessageToNewLog(sGpsTime, CarNum, sOrderId, orderType, orderName, orderResult, sMsg)); base.Invoke(new MethodInvoker(() => MainForm.myLogForms.myNewLog.AddUserMessageToNewLog(sGpsTime, CarNum, sOrderId, orderType, orderName, orderResult, sMsg))); num2++; this._worker.ReportProgress((int)((((double)num2) / ((double)length)) * 100.0)); } } } catch (Exception exception) { Record.execFileRecord("设置平台按时进出站报警-->", exception.Message); } }
private void initForm() { DataTable table = RemotingClient.Alarm_ShowGroupType(); if ((table == null) || (table.Rows.Count <= 0)) { this.cmbGroup.Items.Add("(无)"); this.cmbGroup.Text = "(无)"; } else { this.cmbGroup.DataSource = table; if ((this._pathGroupID != null) && (this._pathGroupID.Trim().Length > 0)) { this.cmbGroup.SelectedValue = this._pathGroupID; } } if (this.PathDot.Split(new char[] { ';' }).Length == 1) { this.pnlCircel.Visible = true; } else { this.pnlCircel.Visible = false; } if (this.preType == itmPreSetPath.PreType.预设报警路线) { this.cmbPathType.addItems("普通", 0); this.cmbPathType.addItems("混凝土", 1); this.cmbPathType.SelectedIndex = 0; this.Text = "请输入路线名称"; } else { this.pnlPath.Visible = false; this.Text = "请输入区域名称"; } }
public void Test() { RemotingClient.OpenDentBusinessIsLocal = true; // Connect to the local mysql server. DataConnection connection = new DataConnection(); connection.SetDb("localhost", "opendental", "root", "", "root", "", DatabaseType.MySql); DataObjectFactory <T> .UseParameters = false; TestTableType(); DataObjectFactory <T> .UseParameters = true; TestTableType(); RemotingClient.OpenDentBusinessIsLocal = false; RemotingClient.ServerName = "localhost"; RemotingClient.ServerPort = 9390; DataObjectFactory <T> .UseParameters = false; TestTableType(); DataObjectFactory <T> .UseParameters = true; TestTableType(); RemotingClient.Disconnect(); }
protected override void btnOK_Click(object sender, EventArgs e) { try { base.btnOK_Click(null, null); if ((!string.IsNullOrEmpty(base.sValue) && this.getParam()) && ((this.m_SimpleCmd.CmdParams != null) && (this.m_SimpleCmd.CmdParams.Count != 0))) { base.reResult = RemotingClient.DownData_icar_SetCommonCmd_XCJLY(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_SimpleCmd); if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); } else { base.DialogResult = DialogResult.OK; } } } catch (Exception exception) { Record.execFileRecord("移动实时监控", exception.Message); } }
private void btnSet_Click(object sender, EventArgs e) { string str = ""; if ((this.tvCollectList.Nodes.Count != 0) && (this.tvCollectList.Nodes[0].Nodes.Count != 0)) { foreach (TreeNode node in this.tvCollectList.Nodes[0].Nodes) { str = str + (node.Tag as DataRow)["id"].ToString() + ","; } } str = str.Trim(new char[] { ',' }); DataTable table = RemotingClient.ExecSql(string.Concat(new object[] { "exec [WebGpsClient_AddMenuCollect] N'", Variable.sUserId, "',", Variable.iModuleId, ",N'", str, "',NULL" })); if (((table != null) && (table.Rows.Count > 0)) && table.Rows[0][0].ToString().Equals("1")) { MessageBox.Show("设置成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("设置失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
private void setGroupText() { this.chkLstArea.Clear(); if (base.OrderCode == CmdParam.OrderCode.取消报警区域值) { DataTable table = RemotingClient.Car_GetRegionInfo(base.sCarId, this.iRegionFeature); if ((table != null) && (table.Rows.Count > 0)) { foreach (DataRow row in table.Rows) { if (!string.IsNullOrEmpty(row["NewRegionId"].ToString()) && !"0".Equals(row["NewRegionId"].ToString())) { CheckBoxItem chk = new CheckBoxItem { Text = row["RegionName"].ToString(), Name = row["NewRegionId"].ToString() }; this.chkLstArea.Add(chk); } } } this.chkLstArea.Enabled = this.cbxExpandRegion.Checked; } }
public ActionResult Index() { RemotingClient _RemotingClient = new RemotingClient(); string ServerName = _RemotingClient.Manger.SelectBestServer(); if (ServerName == "Server1") { return(new RedirectResult("http://localhost:7526")); } if (ServerName == "Server2") { return(new RedirectResult("http://localhost:12014")); } if (ServerName == "Server3") { return(new RedirectResult("http://localhost:12046")); } return(HttpNotFound()); //return Content(bestPerformance.ToString()); //return View(); }
protected override void btnOK_Click(object sender, EventArgs e) { base.btnOK_Click(sender, e); if (!string.IsNullOrEmpty(base.sValue) && this.getParam()) { if (base.OrderCode == CmdParam.OrderCode.回拔坐席电话指令) { base.reResult = RemotingClient.DownData_SendRawPackage(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_SimpleCmd); } else { base.reResult = RemotingClient.DownData_SetPhone(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_SetPhone); } if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); } else { base.DialogResult = DialogResult.OK; } } }
private void InitControl() { DataTable table = new DataTable(); DataColumn column = new DataColumn("Flag"); DataColumn column2 = new DataColumn("Phone"); DataColumn column3 = new DataColumn("Name"); DataColumn column4 = new DataColumn("isOld") { DefaultValue = "0" }; DataColumn column5 = new DataColumn("IsChecked") { DefaultValue = false }; table.Columns.AddRange(new DataColumn[] { column5, column, column2, column3, column4 }); if (MainForm.myCarList.SelectedCarId.Trim().Length > 0) { DataTable phoneNumTextByCarid = RemotingClient.GetPhoneNumTextByCarid(MainForm.myCarList.SelectedCarId.Split(new char[] { ',' })[0]); if (phoneNumTextByCarid != null) { foreach (DataRow row in phoneNumTextByCarid.Rows) { DataRow row2 = table.NewRow(); row2["IsChecked"] = false; row2["Flag"] = row["Flag"]; row2["Phone"] = row["Phone"]; row2["Name"] = row["Name"].ToString().Replace("╆", "#"); row2["isOld"] = "1"; table.Rows.Add(row2); } } phoneNumTextByCarid = null; this.dataGridViewEx1.DataSource = table; table.AcceptChanges(); } }
protected override void btnOK_Click(object sender, EventArgs e) { base.btnOK_Click(sender, e); if (!string.IsNullOrEmpty(base.sValue) && this.getParam()) { base.reResult = RemotingClient.ExecNoQuery(this.m_sExecSql); string sOrderResult = "成功"; if (base.reResult.ResultCode != 0L) { sOrderResult = "失败"; } string str2 = ""; foreach (string str3 in base.sCarId.Split(new char[] { ',' })) { str2 = str2 + "0|" + str3 + ";"; } base.reResult.OrderIDParam = str2; string dBCurrentDateTime = RemotingClient.GetDBCurrentDateTime(); if (string.IsNullOrEmpty(dBCurrentDateTime)) { dBCurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } string sOrderId = "0"; string sOrderType = "发送"; string sOrderName = base.OrderCode.ToString(); string sContent = this.m_sContent; MainForm.myLogForms.myNewLog.AddUserMessageToNewLog(dBCurrentDateTime, base.sCarNum, sOrderId, sOrderType, sOrderName, sOrderResult, sContent); if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); } else { base.DialogResult = DialogResult.OK; } } }
private void btnGetAuthCode_Click(object sender, EventArgs e) { try { this.btnGetAuthCode.Enabled = false; DataTable table = RemotingClient.ExecSql("SELECT TOP 1 [SimNum],[CarNum],[AuthCode],[TerminalType] FROM [GpsJTBSyndata] WHERE SimNum='" + MainForm.myCarList.SelectedSimNum + "' Order by CreateDate Desc"); if ((table != null) && (table.Rows.Count > 0)) { this.txtAuthCode.Text = (table.Rows[0]["AuthCode"] != null) ? table.Rows[0]["AuthCode"].ToString() : ""; } else { MessageBox.Show("未能获取到鉴权码,请重新获取!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } catch (Exception exception) { Record.execFileRecord("通过特权短信控制终端连接指定的中心-->", exception.Message); } finally { this.btnGetAuthCode.Enabled = true; } }
public void GlobalSetup() { #if !NO_REMOTING _remotingServer = new RemotingServer(); _remotingClient = new RemotingClient(); _remotingServer.RegisterActivatedService(typeof(Disposable)); _remotingServer.RegisterActivatedService(typeof(Monk)); _disposableTransparentProxy = new InstanceReference { Instance = _remotingClient.GetService <Disposable>() }; _nonDisposableTransparentProxy = new InstanceReference { Instance = _remotingClient.GetService <Monk>() }; #endif // !NO_REMOTING _disposable = new InstanceReference { Instance = new Disposable() }; _nonDisposable = new InstanceReference { Instance = new Monk() }; }
public void execSend() { base.btnOK_Click(null, null); if (!string.IsNullOrEmpty(base.sValue)) { this.getParam(); if (this.m_PosReport.ReportTiming > 65535) { MessageBox.Show(string.Format("{0}必须在 0~65535 分钟以内!", this.lblTime.Text)); } else { base.reResult = RemotingClient.DownData_SetPosReport(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_PosReport); if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); } else { base.DialogResult = DialogResult.OK; } } } }
private void InitData() { string strCarId = (base.sCarId.Split(new char[] { ',' }).Length > 0) ? base.sCarId.Split(new char[] { ',' })[0].ToString() : base.sCarId; DataTable table = RemotingClient.Car_GetRegionInfo(strCarId, 1); DataTable data = RemotingClient.GetCommonData(strCarId, 2, null); if (data != null) { data.PrimaryKey = new DataColumn[] { data.Columns["CarID"], data.Columns["RegionID"] }; } if ((table != null) && (table.Rows.Count > 0)) { foreach (DataRow row in table.Rows) { row["regiondot"].ToString(); DataRow row2 = this.dt.NewRow(); row2["regionid"] = row["regionid"]; row2["regionName"] = row["regionName"]; bool flag = this.IsRegionInOrOut(data, strCarId, row["RegionID"].ToString(), 1); bool flag2 = this.IsRegionInOrOut(data, strCarId, row["RegionID"].ToString(), 2); bool flag3 = this.IsRegionInOrOut(data, strCarId, row["RegionID"].ToString(), 4); bool flag4 = this.IsRegionInOrOut(data, strCarId, row["RegionID"].ToString(), 8); row2["ischeck"] = ((flag || flag2) || flag3) ? ((object)1) : ((object)flag4); row2["isin"] = flag; row2["isout"] = flag2; row2["inRegion"] = flag3; row2["outRegion"] = flag4; row2["begintime"] = this.GetSetRegionTime(data, strCarId, row["RegionID"].ToString(), "begintime"); row2["endtime"] = this.GetSetRegionTime(data, strCarId, row["RegionID"].ToString(), "endtime"); row2["PathGroupId"] = row["PathGroupID"]; this.dt.Rows.Add(row2); } } this.source.DataSource = this.dt; this.dgvDataList.DataSource = this.source; }
private void SetMenuCollection_Load(object sender, EventArgs e) { this.LoadMenuList(this.menulist_dt.Select("ParentID is null", "MenuOrder"), null); this.SetControlEnable(false); BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate(object sender2, DoWorkEventArgs e2) { DataTable table = RemotingClient.ExecSql(string.Concat(new object[] { "Exec WebGpsClient_GetMenuCollect '", Variable.sUserId, "',", Variable.iModuleId })); if ((table != null) && (table.Rows.Count > 0)) { DataColumn column = new DataColumn("isGroup", typeof(bool)) { DefaultValue = false }; table.Columns.Add(column); this.LoadCollectMenuList(table.Select("", "Sort"), null); } }; worker.RunWorkerCompleted += delegate(object sender22, RunWorkerCompletedEventArgs e22) { this.addCollect(); this.SetControlEnable(true); }; worker.RunWorkerAsync(); }
private void setGroupText() { this.chkLstArea.Clear(); DataTable table = RemotingClient.Car_GetRegionInfo(base.sCarId, this.iRegionFeature); if (table != null) { DataRow[] rowArray = table.Select("NewRegionId is not null"); int length = rowArray.Length; if ((table != null) && (length > 0)) { foreach (DataRow row in rowArray) { CheckBoxItem chk = new CheckBoxItem { Text = row["RegionName"].ToString(), Name = row["NewRegionId"].ToString(), Tag = this.GetRegionType(row["RegionDot"].ToString()) }; this.chkLstArea.Add(chk); } } } this.cbRegionType.SelectedIndex = 0; }
protected override void btnOK_Click(object sender, EventArgs e) { try { base.btnOK_Click(sender, e); if (!string.IsNullOrEmpty(base.sValue)) { this.getParam(); AppRespone respone = RemotingClient.Car_SetCommonCmd_Pass(this.m_appRequest); if (respone.ResultCode != 0) { MessageBox.Show(respone.ResultMsg); } else { base.DialogResult = DialogResult.OK; } } } catch (Exception exception) { MessageBox.Show(exception.Message); } }
private void InitData() { DataTable table = RemotingClient.Car_GetRegionInfo(MainForm.myCarList.SelectedCarId, 0); if (table != null) { for (int i = 0; i < table.Rows.Count; i++) { string str2 = table.Rows[i]["regionName"].ToString(); string str3 = table.Rows[i]["RegionId"].ToString(); string sRegionDot = table.Rows[i]["regionDot"].ToString(); table.Rows[i]["regionType"].ToString(); if (Check.isRectangle(sRegionDot)) { CheckBoxItem chk = new CheckBoxItem { Name = str3, Text = str2, Tag = sRegionDot }; this.chkListRegion.Add(chk); } } } }
private bool getParam() { if (base.OrderCode != CmdParam.OrderCode.载兴趣点) { this.m_PathAlarmList = new PathAlarmList(); this.dataFilter(""); string str2 = this.getCheckPathName(); if (string.IsNullOrEmpty(str2)) { MessageBox.Show("没有选择预设路线!"); return(false); } DataTable table4 = RemotingClient.Car_GetPathRouteByPathName(str2); if ((table4 == null) || (table4.Rows.Count <= 0)) { MessageBox.Show("没有读取到偏移路线数据,请重新设置"); return(false); } foreach (DataRow row2 in table4.Rows) { PathAlarm alarm = new PathAlarm(); ArrayList list = new ArrayList(); string str3 = row2["PathName"] as string; string str4 = row2["alarmPathDot"] as string; if (string.IsNullOrEmpty(str4)) { MessageBox.Show(ERRORPATHAlARM); return(false); } string[] strArray = str4.Split(new char[] { '/' }); alarm.PointCount = strArray.Length; for (int i = 0; i < (strArray.Length - 1); i++) { if (string.IsNullOrEmpty(strArray[i])) { MessageBox.Show(ERRORPATHAlARM); return(false); } string[] strArray2 = strArray[i].Split(new char[] { '*' }); if (strArray2.Length != 2) { MessageBox.Show(ERRORPATHAlARM); return(false); } ParamLibrary.CmdParamInfo.Point point = new ParamLibrary.CmdParamInfo.Point { Longitude = double.Parse(strArray2[0]), Latitude = double.Parse(strArray2[1]) }; list.Add(point); } alarm.Points = list; alarm.PathName = str3; this.m_PathAlarmList.Add(alarm); } if ((this.m_PathAlarmList == null) || (this.m_PathAlarmList.Count < 0)) { return(false); } } else { int iPoiAutn = 0; string str = this.getCheckPathName().Replace("'", "").Replace(",", "/"); if (string.IsNullOrEmpty(str)) { MessageBox.Show("请选择预下载兴趣点的类别!"); return(false); } DataTable table = RemotingClient.Car_GetPOIAuth(); if (((table != null) && (table.Rows.Count > 0)) && (table.Rows[0]["POIAuth"] != DBNull.Value)) { iPoiAutn = int.Parse(table.Rows[0]["POIAuth"].ToString()); } DataTable table2 = RemotingClient.Area_GetUserAreaInfo(); DataTable table3 = null; if ((table2 != null) && (table2.Rows.Count > 0)) { foreach (DataRow row in table2.Rows) { if (row["AreaCode"] != DBNull.Value) { table3 = RemotingClient.Car_GetInterestPointMulti(str, iPoiAutn); break; } } } else { table3 = RemotingClient.Car_GetInterestPointSingle(str, iPoiAutn); } if ((table3 == null) || (table3.Rows.Count <= 0)) { MessageBox.Show("没有兴趣点,请检查是否设置!"); return(false); } this.m_SimpleCmd.MapTypes = str; this.m_SimpleCmd.InsterestPoints = table3; } this.m_PathAlarmList.OrderCode = base.OrderCode; this.m_SimpleCmd.OrderCode = base.OrderCode; return(true); }
private void ConnectToAccountServer() { _RemotingClient = new RemotingClient(_ConfigTree.Get("inter.account", "net.tcp://localhost:4501/")); while (true) { _Log.InfoFormat("Connecting to AccountServer at {0}", _RemotingClient.BaseUri); try { _Service = _RemotingClient.Get<ICharServerService>("CharServer"); } catch (Exception ex) { _Log.Error("Error connecting to AccountServer", ex); Thread.Sleep(5000); continue; } if (_Service != null) break; } _Service.Proxy.RegisterServer("Rhea", _Listener.Address, _Listener.Port); }
private void InitData() { this.InitDataSource(); int iRegionFeature = 0; DataTable table = RemotingClient.Car_GetRegionInfo(MainForm.myCarList.SelectedCarId, iRegionFeature); if (table != null) { for (int i = 0; i < table.Rows.Count; i++) { string str2 = table.Rows[i]["regionName"].ToString(); string str3 = table.Rows[i]["RegionId"].ToString(); string sRegionDot = table.Rows[i]["regionDot"].ToString(); string s = table.Rows[i]["regionType"].ToString(); if ((base.OrderCode != CmdParam.OrderCode.行车记录设置) || Check.isRectangle(sRegionDot)) { DataRow row = this.m_dtRegion.NewRow(); row["regionName"] = str2; row["regionId"] = str3; row["regionDot"] = sRegionDot; if (s.Length == 0) { this.m_dtRegion.Rows.Add(row); continue; } int num3 = int.Parse(s); if (base.OrderCode == CmdParam.OrderCode.行车记录设置) { switch (num3) { case 0: row["InRegion"] = false; row["OutRegion"] = true; row["InOutRegion"] = false; break; case 1: row["InRegion"] = true; row["OutRegion"] = false; row["InOutRegion"] = false; break; case 2: row["InRegion"] = false; row["OutRegion"] = false; row["InOutRegion"] = true; break; } } else if (base.OrderCode == CmdParam.OrderCode.区域报警设置) { switch (num3) { case 0: row["InRegion"] = false; row["OutRegion"] = true; row["InOutRegion"] = table.Rows[i]["NewRegionId"].ToString() == "0"; break; case 1: row["InRegion"] = true; row["OutRegion"] = false; row["InOutRegion"] = table.Rows[i]["NewRegionId"].ToString() == "0"; break; } } this.m_dtRegion.Rows.Add(row); } } } }
protected override void btnOK_Click(object sender, EventArgs e) { base.btnOK_Click(sender, e); if (string.IsNullOrEmpty(this.sValue)) { return; } if (!this.getParam()) { return; } if (base.OrderCode == CmdParam.OrderCode.停止图像监控) { this.reResult = RemotingClient.DownData_StopCapture(this.ParamType, this.sValue, this.sPw, CmdParam.CommMode.未知方式, this.m_StopCapture); } else if (base.OrderCode != CmdParam.OrderCode.定时抓拍图像监控) { if (base.OrderCode == CmdParam.OrderCode.实时图像监控) { this.m_CaptureEx.protocolType = CarProtocolType.交通厅; } this.reResult = RemotingClient.DownData_SetCaptureEx(this.ParamType, this.sValue, this.sPw, CmdParam.CommMode.未知方式, this.m_CaptureEx); } else { string str = ""; foreach (ListViewItem item in this.lvPicTimeList.Items) { string text = item.Text; char[] chrArray = new char[] { ':' }; str = (text.Split(chrArray)[0].Length != 2 ? string.Concat(str, "0", item.Text, ",") : string.Concat(str, item.Text, ",")); } if (string.IsNullOrEmpty(str)) { MessageBox.Show("请输入定时图像抓拍的时间段!"); return; } if (str != "") { str = str.Substring(0, str.Length - 1); } this.reResult = RemotingClient.SetCarPicTimeParam(this.sCarSimNum, this.m_CaptureEx, str); string str1 = "成功"; if (this.reResult.ResultCode != (long)0) { str1 = "失败"; } string str2 = ""; string[] strArrays = this.sCarId.Split(new char[] { ',' }); for (int i = 0; i < (int)strArrays.Length; i++) { string str3 = strArrays[i]; str2 = string.Concat(str2, "0|", str3, ";"); } this.reResult.OrderIDParam = str2; object[] isMulitFramebool = new object[] { "定时抓拍时间-", str, "是否多帧-", this.m_CaptureEx.IsMulitFramebool, ",监控次数-", this.m_CaptureEx.Times, ",间隔时间-", (double)this.m_CaptureEx.Interval * 0.1, ",图像质量-", this.m_CaptureEx.Quality, ",图像亮度-", this.m_CaptureEx.Brightness, ",图像对比度-", this.m_CaptureEx.Contrast, ",图像饱和度-", this.m_CaptureEx.Saturation, ",图像色度", this.m_CaptureEx.Chroma, ",停车是否拍照-", this.m_CaptureEx.IsCapWhenStop }; string str4 = string.Concat(isMulitFramebool); if (this.cmbShootingType.SelectedIndex == 1) { str4 = string.Concat(str4, ",图像分辨率-", this.cmbImageResolution.SelectedItem.ToString()); } string dBCurrentDateTime = RemotingClient.GetDBCurrentDateTime(); if (string.IsNullOrEmpty(dBCurrentDateTime)) { dBCurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } string str5 = "0"; string str6 = "发送"; string str7 = base.OrderCode.ToString(); string str8 = str4; MainForm.myLogForms.myNewLog.AddUserMessageToNewLog(dBCurrentDateTime, this.sCarNum, str5, str6, str7, str1, str8); } if (this.reResult == null) { MessageBox.Show("该终端暂不支持此操作"); base.Close(); return; } if (this.reResult.ResultCode == (long)0) { base.DialogResult = DialogResult.OK; return; } MessageBox.Show(this.reResult.ErrorMsg); }
private void initControlValue() { try { ComboBox comboBox = this.cmbShootingType; int num = 0; int num1 = num; this.cmbImageResolution.SelectedIndex = num; comboBox.SelectedIndex = num1; if (this.IsSimple) { this.Text = "单次图像抓拍"; } else if (base.OrderCode != CmdParam.OrderCode.停止图像监控) { if (base.OrderCode == CmdParam.OrderCode.定时抓拍图像监控) { DataTable dataTable = null; try { try { string str = ""; str = (this.sCarSimNum.IndexOf(',') <= 0 ? this.sCarSimNum : this.sCarSimNum.Substring(0, this.sCarSimNum.IndexOf(','))); string str1 = string.Concat("select pictime from GpsCarPicParam where SimNum = '", str, "'"); dataTable = RemotingClient.ExecSql(str1); if (dataTable != null && dataTable.Rows.Count > 0) { string str2 = dataTable.Rows[0]["PicTime"].ToString(); this.SetPicTime(str2); } } catch (Exception exception) { Record.execFileRecord("获取定时抓拍图像监控", exception.Message); } } finally { if (dataTable != null) { dataTable.Clear(); dataTable = null; } } } string[] strArrays = this.sCarId.Split(new char[] { ',' }); if (!string.IsNullOrEmpty(this.sCarId) && (int)strArrays.Length > 0) { DataTable dataTable1 = RemotingClient.Car_GetCaptureMoniterDataByCarId(strArrays[0]); if (dataTable1 != null && dataTable1.Rows.Count != 0) { bool flag = (dataTable1.Rows[0]["IsMultiFrame"].ToString() == "1" ? true : false); bool flag1 = (dataTable1.Rows[0]["capWhenStop"].ToString() == "1" ? true : false); string str3 = dataTable1.Rows[0]["Times"].ToString(); string str4 = dataTable1.Rows[0]["CatchInterval"].ToString(); string str5 = dataTable1.Rows[0]["Quality"].ToString(); string str6 = dataTable1.Rows[0]["Brightness"].ToString(); string str7 = dataTable1.Rows[0]["Contrast"].ToString(); string str8 = dataTable1.Rows[0]["Saturation"].ToString(); string str9 = dataTable1.Rows[0]["Chroma"].ToString(); string str10 = dataTable1.Rows[0]["CamerasID"].ToString(); string str11 = dataTable1.Rows[0]["CapTureMask"].ToString(); string str12 = dataTable1.Rows[0]["CaptureFlag"].ToString(); int num2 = 0; if (!string.IsNullOrEmpty(str10)) { num2 = int.Parse(str10); } for (int i = 0; i < this.grpCamera.Controls.Count; i++) { CheckBox item = (CheckBox)this.grpCamera.Controls[i]; item.Checked = (num2 & 1 << (i & 31)) != 0; } if (Variable.sAllowMultiShoot.Equals("1")) { if (decimal.Parse(str3) <= this.numWatchTime.Maximum) { this.numWatchTime.Value = decimal.Parse(str3); } else { this.numWatchTime.Value = this.numWatchTime.Maximum; } this.numInterval.Value = decimal.Parse(str4); } this.trkQuality.Value = int.Parse(str5); this.trkLight.Value = int.Parse(str6); this.trkContrast.Value = int.Parse(str7); this.trkSaturation.Value = int.Parse(str8); this.trkChroma.Value = int.Parse(str9); this.chkMultiFrame.Checked = flag; this.chkCapWhenStop.Checked = flag1; int num3 = 0; int num4 = 0; if (!string.IsNullOrEmpty(str11)) { num3 = int.Parse(str11); } if (!string.IsNullOrEmpty(str12)) { num4 = int.Parse(str12); } if (base.OrderCode == CmdParam.OrderCode.多种条件图像监控) { foreach (CheckBox control in this.pnlWatchCondition.Controls) { long num5 = long.Parse(control.Tag.ToString()); control.Checked = ((long)num4 & num5) != (long)0; if (!(control.Text == SaveCapture) || num3 == 0) { continue; } control.Checked = true; } } } } } } catch (Exception exception2) { Exception exception1 = exception2; Record.execFileRecord(base.OrderCode.ToString(), exception1.Message); } }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddScoped <IBizSystemAppService>(u => RemotingClient.CreateBizSystemAppService()); }