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();
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 退还押金
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btBack_Click(object sender, EventArgs e)
        {
            string province = this.cbbProvince.Text;

            if (!string.IsNullOrEmpty(province))
            {
                province = regUperCase.Replace(province, "");
            }
            string carnum = this.tbCarnum.Text;

            if (!string.IsNullOrEmpty(carnum))
            {
                carnum = province + carnum;
            }
            this.tag = basefun.setvaltag(this.tag, "{车牌号码}", carnum);
            //押金处理
            NameObjectList ps = ParamManager.createParam(this.tag);

            //ps["操作类别"] = "退费";
            ps["操作类别"] = "不退费再入场";
            this.tag   = basefun.setvaltag(this.tag, "{收费操作}", "不退费再入场");
            ParamManager.MergeParam(ps, BindManager.getSystemParam(), false);
            this.Query.ExecuteNonQuery("押金处理", ps, ps, ps);
            this.DialogResult = DialogResult.Yes;
            this.Close();
        }
Esempio n. 5
0
 private void FrmFeePara_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.deviceName))
     {
         //读取业务单元和传递参数
         this.paramwin = BindManager.getSystemParam();
         NameObjectList pstrans = BindManager.getTransParam();
         ParamManager.MergeParam(this.paramwin, pstrans);
         unitName = pstrans["name"].ToString();//单元
         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);
         if (unitName == "停车场收费标准")
         {
             lbDeviceInfo.Visible = false;
             this.DownBtn.Visible = false;
             QueryBtn.Visible     = false;
             BtnClose.Visible     = false;
         }
     }
     else
     {
         this.cbodev.Visible    = false;
         this.btnsave.Visible   = false;
         this.lbDeviceInfo.Text = "  " + this.deviceName + "(" + this.deviceID + ")";
     }
 }
Esempio n. 6
0
        /// <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);
        }
Esempio n. 7
0
        private void FrmDepart_Load(object sender, EventArgs e)
        {
            //读取业务单元和传递参数
            this.paramwin = BindManager.getSystemParam();
            NameObjectList pstrans = BindManager.getTransParam();

            ParamManager.MergeParam(this.paramwin, pstrans);
            unitName = pstrans["name"].ToString();//单元
            //获取当前单元名称
            Dictionary <string, string> dict = new Dictionary <string, string>();

            dict.Add("组织机构管理", "@db=组织机构");
            //数据源
            string         datasource = dict[this.unitName];
            NameObjectList ps         = new NameObjectList();

            ParamManager.MergeParam(ps, this.paramwin);
            ps["UnitCode"] = "10";
            unitItem       = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName);
            //绑定数据
            BindManager bg = new BindManager(this);

            dsUnit = bg.BuildDataset(this.unitItem, ps);
            bg.BindFld(this, dsUnit);
            //对树的操作
            bg.BindTrv(this.trvDept, this.dsUnit.Tables["组织机构"], "名称", "ID", "PID", "@名称={名称},@代码={代码},@序号={序号},@ParentCode={ParentCode},@独立管理={独立管理},@分类={分类},@性质={性质},@部门主管={部门主管},@部门职责={部门职责},@班次代码={班次代码},@班次名称={班次名称},@周一={周},@周二={周二},@周三={周三},@周四={周四},@周五={周五},@周六={周六},@周日={周日},@level={level}");
            this.trvDept.ExpandAll();
        }
Esempio n. 8
0
        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();
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        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();
            }
        }
Esempio n. 11
0
        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;
        }
Esempio n. 12
0
        private void FormUpDownWork_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);
            //绑定数据
            BindManager bg = new BindManager(this);

            this.dsUnit = bg.BuildDataset(this.unitItem, this.paramwin);
            bg.BindFld(this, this.dsUnit);
            DataTable tab = this.dsUnit.Tables["接班人员"];

            if (null == tab || tab.Rows.Count < 1)
            {
                return;
            }
            DataTable tabUser = this.dsUnit.Tables["用户信息"];

            foreach (DataRow dr in tabUser.Rows)
            {
                this.ccbNextUser.Items.Add(Convert.ToString(dr["帐号"]));
            }
            tbUserName.Text = BindManager.getUser().UserAccounts;
        }
Esempio n. 13
0
        /// <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);
        }
Esempio n. 14
0
        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");;
        }
Esempio n. 15
0
        private void FrmDevSet_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);
            //绑定数据
            BindManager bg = new BindManager(this);

            this.dsUnit = bg.BuildDataset(this.unitItem, this.paramwin);
            bg.BindFld(this, this.dsUnit);
            //加载串口
            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);
        }
Esempio n. 16
0
        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);
        }
Esempio n. 17
0
        private void FrmDownTime_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"), "时段设置");
            this.Text     = this.unitItem.UnitName;
            //绑定数据
            BindManager bg = new BindManager(this);

            this.dsUnit = bg.BuildDataset(this.unitItem, this.paramwin);
            if (this.dsUnit.Tables.Contains("时段设置"))
            {
                DataTable tab = this.dsUnit.Tables["时段设置"];
                if (tab.Columns.Contains("选择"))
                {
                    tab.Columns.Remove("选择");
                }
                tab.Columns.Add("选择", typeof(bool));
            }
            bg.BindFld(this, this.dsUnit);
            //显示指定字段
            //string cols = "选择 40,timeid 编号 40,timename 时段名称 90,timesec1s 起始时间1 90,timesec1e 截止时间1 90,timesec2s 起始时间2 90,timesec2e 截止时间2 90,";
            //cols += "date1 起始日期 80,date2 截止日期 80,satrest 星期六 50,sunrest 星期天 50";
            //bg.SetGridCols(this.gdValList, cols);
            foreach (DataGridViewColumn c in this.gdValList.Columns)
            {
                c.ReadOnly = !("选择" == c.Name);
            }

            this.lbDeviceInfo.Text = "  " + this.deviceName + "(" + this.deviceID + ")";
        }
Esempio n. 18
0
        /// <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);
        }
Esempio n. 19
0
        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);
        }
Esempio n. 20
0
        /// <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();
        }
Esempio n. 21
0
        /// <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);
        }
Esempio n. 22
0
        /// <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);
        }
Esempio n. 23
0
        private void FrmDeptRest_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);
            //绑定数据
            BindManager bg = new BindManager(this);

            this.dsUnit = bg.BuildDataset(this.unitItem, this.paramwin);
            bg.BindFld(this, this.dsUnit);
        }
Esempio n. 24
0
        private void FrmCarStallSet_Load(object sender, EventArgs e)
        {
            this.paramwin = BindManager.getSystemParam();
            NameObjectList pstrans = BindManager.getTransParam();

            ParamManager.MergeParam(this.paramwin, pstrans);
            unitName  = pstrans["name"].ToString();//单元
            this.Text = unitName;
            //获取当前单元名称
            Dictionary <string, string> dict = new Dictionary <string, string>();

            dict.Add("车位组设置", "@db=车位组设置");
            dict.Add("时段设置", "@db=时段设置");
            if (unitName == "车位组设置")
            {
                panel3.Visible   = false;
                this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
                this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
            }
            else if (unitName == "时段设置")
            {
                panel4.Visible   = false;
                this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
                this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
            }

            //数据源
            string datasource = dict[this.unitName];

            this.dbGrid.Tag = datasource;
            unitItem        = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName);
            //绑定数据
            BindManager bg = new BindManager(this);

            ds = bg.BuildDataset(this.unitItem, this.paramwin);
            bg.BindFld(this, ds);
            //列名显示
            if (datasource == "@db=车位组设置")
            {
                string cols = "车组编号 100,名称 301, 数量 150, 备注 205";
                bg.SetGridCols(this.dbGrid, cols);
            }
            if (datasource == "@db=时段设置")
            {
                string cols = "时段编号 80,时段名称 85, 开始时间1 85,截止时间1 85,开始时间2 85,截止时间2 85,";
                cols += "开始日期 83,截止日期 83,星期六 50,星期日 50";
                bg.SetGridCols(this.dbGrid, cols);
            }
        }
Esempio n. 25
0
        /// <summary>
        /// 用户登录,判断交接班
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btOK_Click(object sender, EventArgs e)
        {
            //软件过期禁止使用

            if (string.IsNullOrEmpty(this.cbbAccount.Text) || string.IsNullOrEmpty(this.tbPassword.Text))
            {
                MessageBox.Show("用户名或密码不能为空!", "登录提示");
                return;
            }
            //判断是停车场否交班
            if (IHandOver() == false)
            {
                MessageBox.Show("该电脑未交班,请首先交接班!", "提示", MessageBoxButtons.OK);
                return;
            }
            else
            {
                PopupBaseEdit pe;
                bool          isNotExist = false;
                User          user       = new User(this.cbbAccount.Text, ref isNotExist);
                if (!isNotExist)
                {
                    isNotExist = !user.login(tbPassword.Text);
                }
                if (isNotExist)
                {
                    MessageBox.Show("用户名或密码不正确!", "登录提示");
                    return;
                }
                //设置当前系统用户并打开主窗口
                BindManager.setUser(user.UserAccounts);
                DataTable tab = this.dsUnit.Tables["当班状态"];
                if (tab != null && tab.Select("值班人='" + this.cbbAccount.Text.Trim() + "'").Length == 0)
                {
                    string operName      = this.cbbAccount.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);
                    this.Query.ExecuteNonQuery("当班状态", ps, ps, ps);
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Esempio n. 26
0
        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);
        }
Esempio n. 27
0
        /// <summary>
        /// 初始化发行器
        /// </summary>
        public void initCmdCard()
        {
            IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName());
            string      myip    = IpEntry.AddressList[0].ToString();

            NameObjectList pstrans = new NameObjectList();

            ParamManager.MergeParam(pstrans, this.paramwin);
            pstrans["IP地址"] = myip;
            //查询数据
            QueryDataRes query = new QueryDataRes(this.unitItem.DataSrcFile);
            DataTable    tab   = dsUnit.Tables["设备设置"];

            tab.Clear();
            query.FillDataSet(tab.TableName, pstrans, this.dsUnit);
            if (null == tab || tab.Rows.Count < 1)
            {
                return;
            }
            if (tab.Rows.Count < 1)
            {
                MessageBox.Show("请设置发行器");
                return;
            }
            DataRow  dr       = this.dsUnit.Tables["设备设置"].Rows[0];
            string   port     = Convert.ToString(dr["串口"]);
            int      baudrate = Convert.ToInt32(dr["波特率"]);
            Parity   parity   = Parity.None;
            int      databits = Convert.ToInt32(dr["数据位"]);
            StopBits stopbits = StopBits.One;

            switch (Convert.ToString(dr["停止位"]))
            {
            case "1.5位": stopbits = StopBits.OnePointFive; break;

            case "2位": stopbits = StopBits.Two; break;

            default: stopbits = StopBits.One; break;
            }
            CommiTarget target  = new CommiTarget(port, baudrate, parity, databits, stopbits);
            int         addrst  = Convert.ToInt32(dr["站址"]);
            bool        success = this.cmdCard.SetTarget(target, addrst, this.radic.Checked);

            if (success)
            {
                this.cmdCard.Buzz(true);
            }
        }
Esempio n. 28
0
        private void FrmOper_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);
            LoadOper(cboEndEmp);
            LoadOper(cboStartEmp);
        }
Esempio n. 29
0
        private void FrmAddMoney_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);
            LoadDept();
        }
Esempio n. 30
0
        /// <summary>
        /// 发卡数据写入数据库
        /// </summary>
        public void WriteDate(string typeName, string cardno)
        {
            DataRow      dr        = this.dsUnit.Tables["发行"].Rows[0];
            QueryDataRes query     = new QueryDataRes(this.unitItem.DataSrcFile);
            bool         isSuccess = BindManager.Save(query, this.dsUnit, this.paramwin);

            if (radic.Checked)
            {
                dr["卡号"] = textEdit1.Text;
            }
            if (radid.Checked)
            {
                dr["卡号"] = cardno;
            }
            dr["消费"]    = EateryCard;
            dr["门禁"]    = DoorCard;
            dr["停车场"]   = ParkCard;
            dr["卡片序列号"] = cardno;
            dr["用户编号"]  = txtNum.Text;
            dr["车型"]    = carTypeNo.ToString();
            dr["车辆颜色"]  = comboBox4.Text;
            // 发卡未成功 可能是修改数据失败
            bool           isflag = false;
            NameObjectList ps     = ParamManager.createParam(dr);

            ParamManager.MergeParam(ps, this.paramwin, false);
            if (typeName == "发行")
            {
                if (chkZD.Checked)
                {
                    dr["车型"] = carTypeNo;
                    if (gridView.FocusedRowHandle + 1 < dsUnit.Tables["用户选择"].Rows.Count)
                    {
                        isflag = this.Query.ExecuteNonQuery("用户选择", ps, ps, ps);
                    }
                }
                isflag = this.Query.ExecuteNonQuery("发行", ps, ps, ps);
            }
            if (isflag)
            {
                XtraMessageBox.Show("发行成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                XtraMessageBox.Show("发行失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }