Exemple #1
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;
        }
Exemple #2
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();
        }
Exemple #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);
            }
        }
Exemple #4
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");;
        }
        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();
        }
Exemple #6
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);
        }
Exemple #7
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 + ")";
     }
 }
Exemple #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();
        }
Exemple #9
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;
        }
Exemple #10
0
        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 + ")";
        }
Exemple #11
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 + ")";
        }
Exemple #12
0
        /// <summary>
        /// 加载控制参数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DownComBtn_Click(object sender, EventArgs e)
        {
            int[] indexlist = this.getCheckedList();
            if (indexlist.Length < 1)
            {
                MessageBox.Show("请选择一个设备", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataTable tab      = this.dbGrid.DataSource as DataTable;
            DataRow   drtarget = tab.Rows[indexlist[0]];

            UnitItem       unitPark = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "设备控制维护");
            BindManager    bg       = new BindManager(this);
            NameObjectList ps       = new NameObjectList();

            ps["code"] = drtarget["编号"];
            DataSet ds = bg.BuildDataset(unitPark, ps);

            FrmCommPara win = new FrmCommPara();

            win.DataSource = ds;
            win.Query      = new QueryDataRes(unitPark.DataSrcFile);
            win.Position   = 0;
            win.Target     = this.getTarget(drtarget);
            win.FunType    = "通讯";
            win.ShowDialog(this);
        }
Exemple #13
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);
        }
Exemple #14
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);
        }
Exemple #15
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);
        }
Exemple #16
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();
            }
        }
Exemple #17
0
        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);
        }
Exemple #18
0
        /// <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();
        }
Exemple #19
0
        /// <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 { }
            }
        }
Exemple #20
0
        /// <summary>
        /// 收取停车费用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btFee_Click(object sender, EventArgs e)
        {
            //删除设备入场记录,并返回tag模拟的出入场tag标记值
            if (null == this.target || this.addrst < 0)
            {
                MessageBox.Show("请检查设备连接或通讯参数后重试!", "通讯提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            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);
            //打印小票
            //编号
            string code = this.query.ExecuteScalar("打印编号序列号", new NameObjectList()).ToString();

            this.tag = basefun.setvaltag(this.tag, "{打印编号}", code);
            string printer = DataAccRes.AppSettings("收费打印机");

            try
            {
                if (!string.IsNullOrEmpty(printer))
                {
                    this.printFee.PrinterSettings.PrinterName = printer;
                }
                this.printFee.Print();
            }
            catch { }
            //删除设备停车记录,保存出入场记录
            CmdProtocol cmdP = new CmdProtocol(false);

            cmdP.setCommand("停车场", "删除一条停车记录", this.tag);
            CommiManager.GlobalManager.SendCommand(this.target, cmdP);
            if (!cmdP.EventWh.WaitOne(2000, false))
            {
                MessageBox.Show("请检查设备连接或通讯参数后重试!", "通讯提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemple #21
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);
        }
        /// <summary>
        /// 从服务器中获得图片
        /// </summary>
        /// <param name="savePath">图片保存相对路径</param>
        /// <param name="pl">显示图片的容器</param>
        public void getPic_Server(string filepath, Panel pl)
        {
            if (string.IsNullOrEmpty(filepath))
            {
                return;
            }
            int    port  = 2010;
            string ipsrv = "127.0.0.1";
            string sport = DataAccRes.AppSettings("Granity文件服务");
            string conn  = DataAccRes.DefaultDataConnInfo.Value;

            if (!string.IsNullOrEmpty(sport))
            {
                try { port = Convert.ToInt32(sport); }
                catch { return; }
            }
            Regex regIP = new Regex(@"server=([\w.\(\)]*)(;|\\)");

            if (regIP.IsMatch(conn))
            {
                Match mt = regIP.Match(conn);
                if (mt.Groups.Count > 1)
                {
                    ipsrv = mt.Groups[1].Value.ToLower();
                }
                if ("(local)" == ipsrv || "127.0.0.1" == ipsrv)
                {
                    ipsrv = Dns.GetHostName();
                }
                ipsrv = Dns.GetHostAddresses(ipsrv)[0].ToString();
            }
            CommiTarget target = new CommiTarget(ipsrv, port, CommiType.TCP);

            target.setProtocol(CmdFileTrans.PTL);
            CmdFileTrans cmd = new CmdFileTrans(false);

            cmd.GetFile(filepath);
            CommiManager.GlobalManager.SendCommand(target, cmd);
            if (cmd.EventWh.WaitOne(new TimeSpan(0, 0, 15), false))
            {
                byte[] data = cmd.FileContext;
                if (data.Length < 1)
                {
                    return;
                }
                MemoryStream stream = new MemoryStream(data);
                pl.BackgroundImage = Image.FromStream(stream);
            }
        }
Exemple #23
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);
            }
        }
Exemple #24
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);
        }
Exemple #25
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);
        }
Exemple #26
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();
        }
Exemple #27
0
        private void FrmSysUsers_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);
            DataTable tab = dsUnit.Tables["新单位树全集"];

            XunFan(tab);
        }
        private void Frm_OpenDoorRecord_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);
            NameObjectList ps = new NameObjectList();

            ParamManager.MergeParam(ps, this.paramwin);
            this.dateStart.EditValue = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm");
            this.dateEnd.EditValue   = System.DateTime.Now.AddDays(1).ToString("yyyy-MM-dd HH:mm");
            ps["StartDate"]          = this.dateStart.EditValue.ToString();
            ps["EndDate"]            = this.dateEnd.EditValue.ToString();
            this.ds = this.bindMgr.BuildDataset(this.unitItem, ps);
            GetDoorInfo();
        }
Exemple #29
0
        /// <summary>
        /// 重置设备记录位置,自
        /// </summary>
        /// <param name="devid">设备ID,为空则清空所有设备记录位置,有则重置为1,没有则添加</param>
        public static void ResetPosition(string devid)
        {
            bool isreset = false;

            if ("true" == devid)
            {
                isreset = true;
            }
            if ("true" == devid || "false" == devid)
            {
                devid = "";
            }
            if (recordpos.ContainsKey(devid))
            {
                return;
            }
            UnitItem     unitItem = null;
            QueryDataRes query    = null;

            if (isreset || !string.IsNullOrEmpty(devid))
            {
                unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "消费监控");
                query    = new QueryDataRes(unitItem.DataSrcFile);
            }
            NameObjectList ps = new NameObjectList();

            if (isreset)
            {
                query.ExecuteNonQuery("记录指针", ps, ps, ps);
            }
            if (string.IsNullOrEmpty(devid))
            {
                recordpos.Clear();
                return;
            }
            ps["消费机"] = devid;
            DataTable tab = query.getTable("记录指针", ps);

            if (null == tab || tab.Rows.Count < 1)
            {
                return;
            }
            recordpos.Add(devid, Convert.ToInt32(tab.Rows[0]["记录位置"]));
        }
        private void FrmEmployeeRegister_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);
            //绑定数据
            bindMgr = new BindManager(this);
            this.ds = bindMgr.BuildDataset(this.unitItem, this.paramwin);
            //    bindMgr.BindFld(this, this.ds);
            DataTable tab = this.ds.Tables["部门信息"];

            this.bindMgr.BindTrv(this.treDept, tab, "名称", "ID", "PID", "@ID={ID},@PID={PID},@编号={编号},@站址={站址}");
            this.treDept.ExpandAll();
            this.treDept.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(treDept_FocusedNodeChanged);
            FrmDataGrid();
        }