//函数
        #region 页面加载
        public FrmHisInOutStationHead()
        {
            InitializeComponent();

            label8.Text = HardwareName.Value(CorpsName.CodeSenderAddress) + ":";
            label4.Text = HardwareName.Value(CorpsName.StationSplace) + ":";
            label5.Text = HardwareName.Value(CorpsName.StaHeadSplace) + ":";

            dtEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dtStartTime.Text = DateTime.Today.ToString();


            #region 加载部门, 工种, 证书, 职务, 职务等级 信息
            if (!lhsh.LoadInfo(treeInfo, cmbWorkType, cmbCerType, cmbDutyName, cmbDutyClass, 1))
            {
                    MessageBox.Show("对不起, 基本数据加载失败!");
                    return;
            }
            #endregion

            #region 加载分站信息
            lhab.LoadInfo(cmb_Station, cmb_StaHead, false);
            #endregion

            treeInfo.ExpandAll();
            treeInfo.SelectedNode = treeInfo.Nodes[0];

            cbPSize.SelectedIndex = 0;

            // 加载设备类型,生产厂家
            DeptBLL deptbll = new DeptBLL();
            deptbll.getEquTYpeCmb(cmbEquType);             // 设备类型
            deptbll.getEquFactoryCmb(cmbFactory);          // 生产厂家
        }
예제 #2
0
        public FrmHisInOutMine()
        {
            InitializeComponent();

            dtEndTime.Text =  DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dtStartTime.Text = DateTime.Today.ToString("yyyy-MM-dd HH:mm:ss");
            #region 加载部门, 工种, 证书, 职务, 职务等级 信息
            if (!lhmb.LoadInfo(treeInfo, cmbWorkType, null, cmbDutyName, null, 1))
            {
                MessageBox.Show("对不起, 基本数据加载失败!");
                return;
            }
            #endregion

            treeInfo.ExpandAll();
            treeInfo.SelectedNode = treeInfo.Nodes[0];

            // 加载设备类型,生产厂家
            DeptBLL deptbll = new DeptBLL();
            deptbll.getEquTYpeCmb(cmbEquType);             // 设备类型
            deptbll.getEquFactoryCmb(cmbFactory);          // 生产厂家

            label8.Text = HardwareName.Value(CorpsName.CodeSenderAddress) + ":";
            dgValue.Columns[0].HeaderText = HardwareName.Value(CorpsName.CodeSenderAddress);
            this.SelectInfo();
        }
        private void LoadCmb()
        {
            DeptBLL deptbll = new DeptBLL();

            deptbll.getDutyNameCmb(cmbDutyName);    // 职务名称
            deptbll.getDutyClassCmb(cmbDutyClass);  // 职务等级
            deptbll.getWorkTypeCmb(cmbWorkType);    // 工种
            deptbll.getCerTypeCmb(cmbCerType);      // 证书类别

            deptbll.getEquTYpeCmb(cmbEquType);      // 设备类型
            deptbll.getEquFactoryCmb(cmb);          // 生产厂家
        }
        private void BindCmd()
        {
            int iYear = DateTime.Now.Year;
            for (int i = iYear - 5; i < iYear + 5; i++)
            {
                cmbYear.Items.Add(i.ToString());
            }
            cmbYear.SelectedIndex = 5;

            //绑定部门、工种
            DeptBLL deptbll = new DeptBLL();
            deptbll.getWorkTypeCmb(cmbWorkType);    // 工种
            deptbll.getDeptAddAll(cmbDept);  // 部门
        }
예제 #5
0
        //获取发码器配置查询条件

        private string GetStrWhereSet()
        {
            string strWhere = string.Empty;
            string tmpStr = cmbDeptList.SelectedValue.ToString();
            if (tmpStr == "0")
            {
                string[,] arr = new string[3, 4]
                {
                    {"发码器地址","=",txtCodeSet.Text,"int"},
                    {"称呼","=",txt.Text,"string"},
                    {"CsTypeID","=",cmbConfigType.Text.ToString() == "所有"?"":cmbConfigType.SelectedValue.ToString(),"int"}
                };
                strWhere = rtbll.SelectWhere(arr, 1);
            }
            else
            {
                DeptBLL dbll = new DeptBLL();
                DataSet ds = dbll.GetDeptInfoAll();
                strWhere = "DeptID = " + tmpStr;
                strWhere = dbll.GetDeptChildAll(ds, strWhere, int.Parse(tmpStr));

                string[,] arr = new string[3, 4]
                {
                    {"发码器地址","=",txtCodeSet.Text,"int"},
                    {"称呼","=",txt.Text,"string"},
                    {"CsTypeID","=",cmbConfigType.Text.ToString() == "所有"?"":cmbConfigType.SelectedValue.ToString(),"int"}
                };
                string tmp = rtbll.SelectWhere(arr, 1);
                // 如果没查询条件

                if (tmp != "")
                {
                    strWhere = "(" + strWhere;
                    strWhere += ") and " + tmp;
                }
            }
            return strWhere;
        }
예제 #6
0
 public void BindDept()
 { 
     DeptBLL dbll = new DeptBLL();
     DataSet ds = dbll.GetDeptInfo();
     DataRow dr = ds.Tables[0].NewRow();
     dr["DeptID"] = 0;
     dr["DeptName"] = "所有";
     ds.Tables[0].Rows.InsertAt(dr,0);
     if (ds.Tables != null && ds.Tables.Count > 0)
     {
         cmbDeptList.DataSource = ds.Tables[0];
         cmbDeptList.DisplayMember = "DeptName";
         cmbDeptList.ValueMember = "DeptID";
     }
     cmbDeptList.Text = "所有";
 }