private void FrmCardMakeS_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 this.bindMgr = new BindManager(this); this.dsUnit = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.bindMgr.BindFld(this, dsUnit); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); ///检测发行器 /// bindMgr.SetGridCols(this.dbUser, "姓名,卡号,部门名称"); DataTable taboption = initSet(); if (null == taboption || taboption.Rows.Count < 1) { XtraMessageBox.Show("请设置发行器", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } lblMessage.Text = ""; ShowType(); tabCardApp.SelectedTabPageIndex = 2; }
private void Uc_DoorControlBaseinfo_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 this.bindMgr = new BindManager(this); this.paramwin["code"] = DBNull.Value; this.ds = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); this.bindMgr.BindFld(this, ds); // this.bindMgr.BindFld(this, ds, true); //对树的操作 DataTable tab = this.ds.Tables["门禁管理"]; this.bindMgr.BindTrv(this.TreeGroup, tab, "名称", "id", "PID", "@ID={ID},@PID={PID},@编号={编号},@站址={站址}"); this.TreeGroup.ExpandAll(); this.txtDoorName.EditValueChanged += new EventHandler(txtEditValueChanged); this.txtGroupName.EditValueChanged += new EventHandler(txtEditValueChanged); this.txtControlDor.EditValueChanged += new EventHandler(txtEditValueChanged); BandCheckChangeEventargs(this.xtraTabExtendPara); GetEffTime(); }
/// <summary> /// 根据条件,查询出相应的记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtQuery_Click(object sender, EventArgs e) { if (this.dateStart.Text == string.Empty) { XtraMessageBox.Show("请输入开始时间", "系统提示!"); return; } if (this.dateEnd.Text == string.Empty) { XtraMessageBox.Show("请输入结束时间", "系统提示!"); return; } NameObjectList pstrans = new NameObjectList(); ParamManager.MergeParam(pstrans, this.paramwin); pstrans["StartDate"] = this.dateStart.EditValue.ToString(); pstrans["EndDate"] = this.dateEnd.EditValue.ToString(); //查询数据 QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); DataTable tab = this.grdConsumeList.DataSource as DataTable; if (null == tab) { return; } tab.Clear(); query.FillDataSet(tab.TableName, pstrans, this.ds); }
private void FrmDoorMonitor_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 this.bindMgr = new BindManager(this); this.paramwin["code"] = DBNull.Value; this.ds = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); this.bindMgr.BindFld(this, ds); //对树的操作 DataTable tab = this.ds.Tables["门禁监控"]; this.bindMgr.BindTrv(this.trvDoorStall, tab, "名称", "ID", "PID", "@ID={ID},@PID={PID}"); this.trvDoorStall.ExpandAll(); this.tabStateDoor = this.ds.Tables["门禁巡检状态"]; if (gridViewInfo.RowCount > 0) { gridViewInfo.DeleteRow(0); } }
/// <summary> /// 根据部门检索 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cboDept_TextChanged(object sender, EventArgs e) { string filter = "c.名称 like '%{0}%'"; if (cboDept.Text == "全部") { filter = ""; } else { filter = string.Format(filter, this.cboDept.Text.Replace("'", "''")); } //得到数据源 QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); DataTable tab = dsUnit.Tables["补助管理"];; if (null == tab) { return; } tab.Clear(); query.FillDataSet(tab.TableName, this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.dsUnit); detpList.Items.Clear(); foreach (DataRow dr in tab.Rows) { this.detpList.Items.Add(dr["姓名"] + "(" + dr["卡号"] + ")"); } }
private void FrmLogin_Load(object sender, EventArgs e) { FormFactory dbhelp = new FormFactory(); if (!dbhelp.ConnectionResult("value", "Granity.granityMgr", "select * from 用户信息表")) { FrmDBDatabase db = new FrmDBDatabase(); db.ShowDialog(); if (!db.Success) { return; } } try { //读取业务单元和传递参数 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 BindManager bg = new BindManager(this); this.dsUnit = bg.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); bg.BindFld(this, this.dsUnit); setSystemTime(); } catch { this.Close(); } }
/// <summary> /// 窗口初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ParkStallSetFrm_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 this.bindMgr = new BindManager(this); this.paramwin["code"] = DBNull.Value; this.ds = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); this.bindMgr.BindFld(this, ds); //对树的操作 DataTable tab = this.ds.Tables["停车场管理"]; this.bindMgr.BindTrv(this.trvParkStall, tab, "名称", "id", "PID", "@ID={ID},@PID={PID},@编号={编号},@站址={站址}"); this.trvParkStall.ExpandAll(); tab.ColumnChanged += new DataColumnChangeEventHandler(tab_ColumnChanged); if (this.trvParkStall.Nodes.Count > 0) { this.trvParkStall.FocusedNode = this.trvParkStall.Nodes[0]; } this.grpParam.Hide(); this.grpFee.Dock = DockStyle.Fill; this.grpParam.Dock = DockStyle.Fill; // //初始化收费参数编辑控件事件 this.setTextChanged(this.tabFeeStd); this.setCheckedChanged(this.grpbAccept); this.setCheckedChanged(this.grpbCardType); this.setCheckedChanged(this.grpbChannel); this.plCarType.Dock = DockStyle.Fill; //加载串口 string[] Com = { "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "COM10" }; LoadComBox("串口", Com); //加载波特率 string[] BTL = { "4800", "9600", "19200", "38400", "56000" }; LoadComBox("波特率", BTL); //加载数据位 string[] DataW = { "5", "6", "7", "8" }; LoadComBox("数据位", DataW); //加载停止位 string[] DopW = { "1", "2" }; LoadComBox("停止位", DopW); //加载停止位 string[] DK = { "30000", "60000" }; LoadComBox("端口", DK); //加载通讯类别 string[] type = { "TCP/IP(局域网)", "UDP/IP(局域网)", "串口" }; LoadComBox("通讯类别", type); this.TxtStalname.EditValueChanged += new EventHandler(txtEditValueChanged); this.AllNoTxt.EditValueChanged += new EventHandler(txtEditValueChanged); this.RetainStaTxt.EditValueChanged += new EventHandler(txtEditValueChanged); this.ComIpTxt.EditValueChanged += new EventHandler(txtEditValueChanged); }
/// <summary> /// 窗口初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ParkStallSetFrm_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 this.bindMgr = new BindManager(this); this.paramwin["code"] = DBNull.Value; this.ds = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); this.bindMgr.BindFld(this, ds); //对树的操作 DataTable tab = this.ds.Tables["停车场管理"]; this.bindMgr.BindTrv(this.trvParkStall, tab, "名称", "ID", "PID", "@ID={ID},@PID={PID},@编号={编号},@站址={站址}"); this.trvParkStall.ExpandAll(); tab.ColumnChanged += new DataColumnChangeEventHandler(tab_ColumnChanged); if (this.trvParkStall.Nodes.Count > 0) { this.trvParkStall.SelectedNode = this.trvParkStall.Nodes[0]; } this.panGrpParam.Hide(); this.panGrpFee.Dock = DockStyle.Fill; this.panGrpParam.Dock = DockStyle.Fill; //初始化收费参数编辑控件事件 this.setTextChanged(this.tabFeeStd); this.setCheckedChanged(this.grpbAccept); this.setCheckedChanged(this.grpbCardType); this.setCheckedChanged(this.grpbChannel); }
private void FrmReadRecord_Load(object sender, EventArgs e) { this.UnitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "收费站"); //初始化下拉框字典 this.Query = new QueryDataRes(this.UnitItem.DataSrcFile); this.paramSystem = BindManager.getSystemParam(); DataSet ds = new DataSet("卡片类型"); this.Query.FillDataSet("卡片类型", this.paramSystem, ds); this.Query.FillDataSet("卡片类型", this.paramSystem, ds); DataRow dr = ds.Tables["卡片类型"].NewRow(); ds.Tables["卡片类型"].Rows.InsertAt(dr, 0); dr = ds.Tables["卡片类型"].NewRow(); ds.Tables["卡片类型"].Rows.InsertAt(dr, 0); DataGridViewComboBoxColumn col = this.gdRecord.Columns["卡类"] as DataGridViewComboBoxColumn; col.ValueType = typeof(int); col.DataSource = ds.Tables["卡片类型"]; col.DisplayMember = "卡类"; col.ValueMember = "编号"; col = this.gdRecord.Columns["车型"] as DataGridViewComboBoxColumn; col.ValueType = typeof(int); col.DataSource = ds.Tables["车型"]; col.DisplayMember = "车类"; col.ValueMember = "编号"; lbDevInfo.Text = this.DeviceName + "(" + this.DeviceID + ")"; }
private void FrmCardUpdate_Load(object sender, EventArgs e) { //读取业务单元和传递参数 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 BindManager bg = new BindManager(this); this.dsUnit = bg.BuildDataset(this.unitItem, this.paramwin); bg.BindFld(this, this.dsUnit); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); bg.SetGridCols(this.dbUser, "姓名,卡号,部门名称"); DataTable tab = initDev(); if (null == tab || tab.Rows.Count < 1) { XtraMessageBox.Show("请设置发行器", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } ShowType(); this.cboDTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.cboETime.Text = DateTime.Now.ToString("yyyy-MM-dd");; this.cboPTime.Text = DateTime.Now.ToString("yyyy-MM-dd");; }
/// <summary> /// 条件查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtQuery_Click(object sender, EventArgs e) { if (this.dateStart.Text == string.Empty) { XtraMessageBox.Show("请输入开始时间", "系统提示!"); return; } if (this.dateEnd.Text == string.Empty) { XtraMessageBox.Show("请输入结束时间", "系统提示!"); return; } NameObjectList pstrans = new NameObjectList(); ParamManager.MergeParam(pstrans, this.paramwin); pstrans["StartTime"] = this.dateStart.EditValue.ToString(); pstrans["EndTime"] = this.dateEnd.EditValue.ToString(); pstrans["CardType"] = this.CbCardtype.EditValue != null?this.CbCardtype.EditValue.ToString() : string.Empty; pstrans["CarNo"] = this.TxtCarNo.Text.Trim(); pstrans["UsrNo"] = this.txtuserID.Text.Trim(); pstrans["Name"] = this.txtuserName.Text.Trim(); pstrans["CardNo"] = this.TxtCardNo.Text.Trim(); //查询数据 QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); BindManager bg = new BindManager(this); DataSet ds = bg.BuildDataset(this.unitItem, pstrans); bg.BindFld(this, ds); }
private void FrmRight_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据0 this.bindMgr = new BindManager(this); this.paramwin["code"] = DBNull.Value; this.ds = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); DataTable tabEquipment = this.ds.Tables["停车场设备信息"]; this.bindMgr.BindTrv(this.treEquipmentAll, tabEquipment, "名称", "id", "PID", "@ID={ID},@PID={PID},@编号={编号}"); this.treEquipmentAll.ExpandAll(); DataTable tabDept = this.ds.Tables["停车场卡"]; this.bindMgr.BindTrv(this.treDept, tabDept, "名称", "id", "PID", "@ID={ID},@PID={PID},@用户编号={用户编号},@卡号={卡号}"); this.treDept.ExpandAll(); this.treDept.AfterCheckNode += new NodeEventHandler(treDept_AfterCheckNode); this.treDept.FocusedNodeChanged += new FocusedNodeChangedEventHandler(treDept_FocusedNodeChanged); this.treDept.FocusedNode = this.treDept.Nodes.ParentNode; this.treEquipmentAll.AfterCheckNode += new NodeEventHandler(treEquipmentAll_AfterCheckNode); }
private void BtnRefsh_Click_1(object sender, EventArgs e) { QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); this.dsUnit.Tables["时段设置"].Clear(); query.FillDataSet("时段设置", this.paramwin, this.dsUnit); }
private void BtQuery_Click(object sender, EventArgs e) { if (this.dateStart.Text == string.Empty) { XtraMessageBox.Show("请输入开始时间", "系统提示!"); return; } if (this.dateEnd.Text == string.Empty) { XtraMessageBox.Show("请输入结束时间", "系统提示!"); return; } NameObjectList pstrans = new NameObjectList(); ParamManager.MergeParam(pstrans, this.paramwin); pstrans["StartDate"] = this.dateStart.EditValue.ToString(); pstrans["EndDate"] = this.dateEnd.EditValue.ToString(); pstrans["Dept"] = this.lookDept.EditValue; pstrans["EmployNO"] = (object)this.txtEmployName.Text; //查询数据 QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); BindManager bg = new BindManager(this); ds = bg.BuildDataset(this.unitItem, pstrans); Granity.granityMgr.Report.viwReports View = new Granity.granityMgr.Report.viwReports(); View.ReportName = "考勤明细查询"; View.ds = ds; View.StartTime = this.dateStart.Text.Trim(); View.EndTime = this.dateEnd.Text.Trim(); View.Activate(); View.Dock = DockStyle.Fill; this.groReport.Controls.Clear(); this.groReport.Controls.Add(View); }
private void FrmDorUsers_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据0 this.bindMgr = new BindManager(this); this.paramwin["code"] = DBNull.Value; this.ds = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); DataTable tabDor = this.ds.Tables["门禁分组"]; this.bindMgr.BindTrv(this.treDoorAll, tabDor, "名称", "id", "PID", "@ID={ID},@PID={PID},@编号={编号},@站址={站址}"); this.treDoorAll.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(treDoorAll_FocusedNodeChanged); this.treDoorAll.FocusedNode = null; this.treDoorAll.AfterCheckNode += new NodeEventHandler(treDoorAll_AfterCheckNode); this.treDoorAll.ExpandAll(); DataTable tabDept = this.ds.Tables["部门用户信息"]; this.bindMgr.BindTrv(this.treDeptUser, tabDept, "名称", "id", "PID", "@ID={ID},@PID={PID},@用户编号={用户编号},@站址={站址}"); this.treDeptUser.ExpandAll(); }
private void trvDept_AfterSelect(object sender, TreeViewEventArgs e) { if (null == e.Node) { return; } //查询明细数据 DataTable tabDetail = this.dsUnit.Tables["组织机构"]; string tag = Convert.ToString(e.Node.Tag); NameObjectList ps = new NameObjectList(); ParamManager.MergeParam(ps, this.paramwin); ParamManager.MergeParam(ps, ParamManager.createParam(tag)); ps["UnitCode"] = basefun.valtag(e.Node.Tag.ToString(), "代码"); if (null != tabDetail) { tabDetail.Clear(); } QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); query.FillDataSet("组织机构", ps, this.dsUnit); checkBox1.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["独立管理"].ToString()); checkBox2.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周一"].ToString()); checkBox3.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周二"].ToString()); checkBox4.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周三"].ToString()); checkBox5.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周四"].ToString()); checkBox6.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周五"].ToString()); checkBox7.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周六"].ToString()); checkBox8.Checked = Convert.ToBoolean(this.dsUnit.Tables[0].Rows[0]["周日"].ToString()); //if (null == tabChanged) // return; //tabDetail = this.dsUnit.Tables["组织机构"]; //TreeNode trnsel, trn; //trn = trnsel = e.Node; //string strdept = ""; //while (null != trnsel) //{ // if (null != trn.FirstNode) // { // trn = trn.FirstNode; // continue; // } // string t = Convert.ToString(trn.Tag); // strdept += " or 部门='" + basefun.valtag(t, "部门") + "'"; // if (trnsel == trn) // break; // if (null != trn.NextNode) // trn = trn.NextNode; // else // trn = trn.Parent; // if (trnsel == trn) // break; //} //if (strdept.Length > 0) // strdept = strdept.Substring(3); //BindManager.UpdateTable(tabDetail, tabChanged, strdept); }
/// <summary> /// 查询设备清单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DevListBtn_Click(object sender, EventArgs e) { dbGrid.Show(); DevListGrid.Hide(); QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); this.dsUnit.Tables["compara"].Clear(); query.FillDataSet("compara", this.paramwin, this.dsUnit); }
/// <summary> /// 确定交班 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tbOK_Click(object sender, EventArgs e) { bool isNotExist = false; string user = Convert.ToString(this.ccbNextUser.Text); string pws = this.tbPassword.Text; if (string.IsNullOrEmpty(user) || string.IsNullOrEmpty(pws)) { MessageBox.Show("请选择接班人和输入接班人密码!", "接班提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } this.paramwin["交班人"] = BindManager.getUser().UserAccounts; this.paramwin["密码"] = pws; User user1 = new User(user, ref isNotExist); if (!isNotExist) { isNotExist = !user1.login(tbUserName.Text, pws); } if (isNotExist) { MessageBox.Show("密码不正确!", "系统提示"); return; } QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); this.paramwin["操作员"] = BindManager.getUser().UserName; this.paramwin["值班人"] = ccbNextUser.Text; IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName()); string myip = IpEntry.AddressList[0].ToString(); this.paramwin["电脑IP"] = myip; bool isSuccess = query.ExecuteNonQuery("交接班", this.paramwin, this.paramwin, this.paramwin); if (!isSuccess) { MessageBox.Show("执行交接班时失败请与管理员联系!", "接班提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } BindManager.setUser(user); string operName = this.ccbNextUser.Text.Trim(); string workStartTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string ip = this.paramwin.AllValues.GetValue(2).ToString(); string tag = string.Empty; tag = basefun.setvaltag(tag, "值班人", operName); tag = basefun.setvaltag(tag, "接班时间", workStartTime); tag = basefun.setvaltag(tag, "电脑IP", ip); NameObjectList ps = ParamManager.createParam(tag); ParamManager.MergeParam(ps, this.paramwin, false); query.ExecuteNonQuery("当班状态", ps, ps, ps); MessageBox.Show("已经成功执行交接班!\r\n" + this.ccbNextUser.Text + " 开始工作!", "接班提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.Yes; this.Close(); }
/// <summary> /// 构造函数指定构造指令ID(指令ID是可更改的) /// </summary> /// <param name="id">指令ID</param> public CmdProtocol(string id) : base(id) { try { this.query = new QueryDataRes(dbSrc); } catch (Exception ex) { } this.TimeOut = new TimeSpan(200 * 10000); this.TimeFailLimit = new TimeSpan(600 * 10000); this.TimeLimit = new TimeSpan(600 * 10000); this.IsResposeHandle = this.isResponse; }
public void deleteAll(string devid) { NameObjectList ps = this.buildParam(this, null); ps["设备"] = devid; unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "设备控制维护"); QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); query.ExecuteDelete("删除白名单_全部", ps); }
/// <summary> /// 保存补助记录,修改卡片余额 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click_1(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtMoney.Text) || moneyList.Items.Count < 1) { XtraMessageBox.Show("补助金额为空或者卡号为空!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } #region 循环写入数据 for (int i = 0; i < moneyList.Items.Count; i++) { string[] sArray = moneyList.Items[i].ToString().Split('('); foreach (string j in sArray) { if (j.ToString().Contains(")")) { string[] ssArray = j.ToString().Split(')'); foreach (string h in ssArray) { if (!string.IsNullOrEmpty(h.ToString())) { string CardNo = h.ToString(); NameObjectList ps = new NameObjectList(); ParamManager.MergeParam(ps, this.paramwin); ps["卡号"] = CardNo; #region 查询当前记录 QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); DataTable tab = dsUnit.Tables["补助信息"]; if (null == tab) { return; } tab.Clear(); query.FillDataSet(tab.TableName, ps, this.dsUnit); #endregion //保存充值记录并且更新卡片余额 DataRow dr = tab.Rows[0]; dr["卡号"] = CardNo; dr["补助充值"] = txtMoney.Text; dr["操作员"] = BindManager.getUser().UserName; NameObjectList ps1 = ParamManager.createParam(dr); ParamManager.MergeParam(ps1, this.paramwin, false); this.Query.ExecuteNonQuery("补助信息", ps1, ps1, ps1); } } } } } #endregion moneyList.Items.Clear(); MessageBox.Show("补助成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); }
/// <summary> /// 搜索停车场验票机 /// </summary> private void searchPark() { QueryDataRes query = new QueryDataRes("cardone"); NameObjectList ps = new NameObjectList(); DataTable tab = query.getTable("devlist", ps); if (null == tab || tab.Rows.Count < 1) { return; } for (int i = 0; i < tab.Rows.Count; i++) { DataRow dr = tab.Rows[i]; string commitype = Convert.ToString(dr["访问方式"]); if ("1" == commitype) { commitype = "Ser"; } if ("2" == commitype) { commitype = "TCP"; } if ("Ser" != commitype && "TCP" != commitype) { commitype = "UDP"; } string port = Convert.ToString(dr["端口"]); if ("Ser" == commitype) { port = "COM" + port; } //表格字段顺序:序号, 设备类型, 设备名称, IP地址, 端口, 通讯类别, 通讯站址, 子网掩码, 默认网关, 物理地址 string[] ipAddrs = new string[10]; ipAddrs[0] = i.ToString(); ipAddrs[1] = "停车场验票机"; ipAddrs[2] = Convert.ToString(dr["名称"]); ipAddrs[3] = Convert.ToString(dr["地址"]); ipAddrs[4] = port; ipAddrs[5] = commitype; ipAddrs[6] = Convert.ToString(dr["设备地址"]); ipAddrs[7] = ""; ipAddrs[8] = ""; ipAddrs[9] = ""; DataGridViewRow drPark = this.getRow(ipAddrs[3], port, ipAddrs[6]); if (null != drPark) { drPark.SetValues(ipAddrs); } else { this.gdGrid.Rows.Add(ipAddrs); } } }
/// <summary> /// 设备巡检管理构造函数 /// </summary> public DeviceMonitorMgrBak() { this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "设备监控服务"); this.query = new QueryDataRes(this.unitItem.DataSrcFile); //2分钟执行一次 tmService.Interval = 360000; tmService.Elapsed += new ElapsedEventHandler(tmService_Elapsed); tmService.Enabled = true; tmService.Start(); }
/// <summary> /// 门禁设备 /// </summary> public DeviceDoor() : base() { if (null == unitItem) { unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "门禁监控"); } this.query = new QueryDataRes(unitItem.DataSrcFile); this.qyemp = new QueryDataRes(unitItem.DataSrcFile); if (null == qydata) { qydata = new QueryDataRes(unitItem.DataSrcFile); } //设置默认超时时间 string tmout = DataAccRes.AppSettings("commiTimeout"); string icn = DataAccRes.AppSettings("commiCnnout"); string tminv = DataAccRes.AppSettings("commiSecondeInv"); if (!string.IsNullOrEmpty(tmout)) { try { int timeout = Convert.ToInt16(tmout); this.waitTime = new TimeSpan(0, 0, 0, 0, timeout / 10 * 35); } catch { } } if (!string.IsNullOrEmpty(icn)) { try { this.cnnout = Convert.ToInt32(icn); CNtimeout = this.cnnout; } catch { } } if (!string.IsNullOrEmpty(tminv)) { try { int inv = 2; int.TryParse(tminv, out inv); int mi = inv / 60; if (inv > 60) { inv = inv % 60; } this.tsinv = new TimeSpan(0, 0, mi, inv); this.tsbusy = new TimeSpan(60 * tsinv.Ticks); } catch { } } }
/// <summary> /// 获取最新数据 /// </summary> public void getNewDataByCardNo(string cardno) { NameObjectList pstrans = new NameObjectList(); ParamManager.MergeParam(pstrans, this.paramwin); pstrans["卡号"] = cardno; //查询数据 QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); DataTable tab = dsUnit.Tables["卡检测"]; tab.Clear(); query.FillDataSet(tab.TableName, pstrans, this.dsUnit); }
/// <summary> /// 查询是否是操作员,操作员要交班 /// </summary> /// <returns></returns> public DataTable User() { //得到数据源 QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); this.dsUnit.Tables["操作员"].Clear(); //执行查询操作 NameObjectList ps = new NameObjectList(); ps["帐号"] = cbbAccount.Text; query.FillDataSet("操作员", ps, this.dsUnit); return(dsUnit.Tables["操作员"]); }
/// <summary> /// 定时执行业务 /// </summary> /// <param name="obj"></param> void executeTimer(object obj) { DateTime dt = DateTime.Today.AddDays(-1); NameObjectList ps = new NameObjectList(); ps.Add("开始日期", dt); ps.Add("结束日期", dt); QueryDataRes query = new QueryDataRes("基础类"); DataTable tab = query.getTable("考勤人员列表", null); if (null == tab || tab.Rows.Count < 1) { isTmRunning = false; return; } NameValueCollection data = new NameValueCollection(); data["服务"] = "考勤作业"; DataColumnCollection cols = tab.Columns; foreach (DataRow dr in tab.Rows) { foreach (DataColumn c in cols) { ps[c.ColumnName] = Convert.ToString(dr[c]); } try { bool b = query.ExecuteNonQuery("考勤人员列表", ps, ps, ps); if (b) { continue; } } catch (Exception ex) { foreach (string key in ps.AllKeys) { data.Add(key, Convert.ToString(ps[key])); } LogMessage(ex, data, EventLogEntryType.Error); continue; } foreach (string key in ps.AllKeys) { data.Add(key, Convert.ToString(ps[key])); } LogMessage("考勤作业失败!", data, EventLogEntryType.Warning); } isTmRunning = false; }
private void BtSave_Click(object sender, EventArgs e) { QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); bool isSuccess = BindManager.Save(query, this.ds, this.paramwin); if (!isSuccess) { XtraMessageBox.Show("保存失败,请检查数据是否合法!", "保存提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { XtraMessageBox.Show("保存成功!", "保存提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void FrmSysRoles_Load(object sender, EventArgs e) { //初始化参数和单元 this.paramwin = BindManager.getSystemParam(); NameObjectList pstrans = BindManager.getTransParam(); ParamManager.MergeParam(this.paramwin, pstrans); this.unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName); //绑定数据 this.bindMgr = new BindManager(this); this.paramwin["code"] = DBNull.Value; this.ds = this.bindMgr.BuildDataset(this.unitItem, this.paramwin); this.Query = new QueryDataRes(this.unitItem.DataSrcFile); this.bindMgr.BindFld(this, ds); }
/// <summary> /// 初始化发行器 /// </summary> /// <returns></returns> public DataTable initDev() { IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName()); string myip = IpEntry.AddressList[0].ToString(); string filter = "(电脑='{0}' or IP地址='{1}') and 通讯类别='发行器'"; filter = string.Format(filter, Dns.GetHostName(), myip); DataTable tab = this.dsUnit.Tables["发行器"]; tab.Clear(); QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile); query.FillDataSet("发行器", this.paramwin, ParamManager.setMacroParam(MacroPmType.FW, filter), this.dsUnit); return(tab); }