Ejemplo n.º 1
0
        private objCl initPanelContentAddcl(objCl o)
        {
            //throw new NotImplementedException();
            Stopwatch tmpWatch = new Stopwatch();
            try
            {
                tmpWatch.Start();

                this.SuspendLayout();

                _objcl2 = (objCl)o;

                _lstContr2 = new Control[o.gwNum + o.UserPersonNum + o.UserNullNum];

                //this.Text = "人员揭示:开始初始化控-->关位:" + o.gwNum + "个";

                //************todo something


                //关位
                _objcl2.u_gwNum = 0;
                for (int i = 0; i < o.gwNum; i++)
                {
                    UserPersonsList tmpd = new UserPersonsList();
                    tmpd.Visible = false;
                    tmpd.GuanweiID = i.ToString();
                    tmpd.RealCount = i;
                    tmpd.StandardCount = i;
                    //tmpd.Left = (i % 14) * tmpd.Width;
                    //tmpd.Top = (i % 10) * tmpd.Height;
                    _lstContr2[i] = tmpd;
                }

                //人员

                //this.Text = "人员揭示:初始化控-->关位:" + o.gwNum + ",已完成.开始人员控件:" + o.UserPersonNum + "个";

                _objcl2.u_UserPersonNum = o.gwNum;
                for (int i = o.gwNum; i < (o.gwNum + o.UserPersonNum); i++)
                {
                    UserPerson tmpd = new UserPerson();
                    tmpd.Visible = false;
                    tmpd.UserID = i.ToString();
                    tmpd.UserName = "******" + i.ToString();
                    //tmpd.Left = (i % 14) * tmpd.Width;
                    //tmpd.Top = (i % 10) * tmpd.Height;
                    _lstContr2[i] = tmpd;
                }
                //空位

                //this.Text = "人员揭示:初始化控-->关位:" + o.gwNum + ",人员:" + o.UserPersonNum + ",已完成.开始空位人员控件:" + o.UserNullNum + "个";


                var tmpi = o.gwNum + o.UserPersonNum;
                _objcl2.u_UserNullNum = tmpi;
                for (int i = tmpi; i < (o.gwNum + o.UserPersonNum + o.UserNullNum); i++)
                {
                    UserPersonNull tmpd = new UserPersonNull();
                    tmpd.Visible = false;
                    tmpd.UserID = i.ToString();
                    tmpd.UserName = "******" + i.ToString();
                    //tmpd.Left = (i % 14) * tmpd.Width;
                    //tmpd.Top = (i % 10) * tmpd.Height;
                    _lstContr2[i] = tmpd;
                }

                //************end todo

                o.cl.Controls.AddRange(_lstContr2);

                this.ResumeLayout(false);
                this.PerformLayout();
                tmpWatch.Stop();

                var msg = "人员调换:初始化控件,关位:" + o.gwNum + ",人员:" + o.UserPersonNum + ",空位:" + o.UserNullNum + ",Time:" + tmpWatch.Elapsed.ToString();
                Program.logFlagStart(log, tmpWatch, msg);


                return o;
            }
            catch (Exception ex)
            {
                return null;
                throw;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 选择判定,并设置调动状态,调动From,To数据 
        /// </summary>
        /// <param name="selectFlg">1:【考勤】工种;  2:【考勤】(标配)人员;  3:【考勤】(标配以外)人员; 4:【考勤】(空位)人员
        /// 5:【未定义】人员; 6:【未定义】(空位)人员;  7:【支援】人员; 8:【支援】(空位)人员</param>
        /// <param name="ObjSender">工种,人员,空位</param>
        /// <summary>
        private void checkSelectPersons(int selectFlg, object ObjSender)
        {
            //this.TopMost = false;
            if (strFromSelFlg == 0) //from没有选择的情况
            {
                //From选择类型保存
                strFromSelFlg = selectFlg;
                switch (strFromSelFlg)
                {//根据from选择类型,设定To的那些可选

                    case 2://From: 2:【考勤】(标配)人员
                        bPlistFlg = true;//【考勤】工种可选flg
                        bPerFlg = true;//【考勤】关位可选flg
                        bPerNullFlg = true;//【考勤】空位可选flg
                        bProFlg = false;//【未定义】关位可选flg
                        bProNullFlg = true;//【未定义】空位可选flg
                        bSupFlg = false;//【支援】关位可选flg
                        bSupNullFlg = true;//【支援】空位可选flg
                        break;
                    case 5://From: 5:【未定义】人员
                        bPlistFlg = true;//【考勤】工种可选flg
                        bPerFlg = true;//【考勤】关位可选flg
                        bPerNullFlg = true;//【考勤】空位可选flg
                        bProFlg = false;//【未定义】关位可选flg
                        bProNullFlg = false;//【未定义】空位可选flg
                        bSupFlg = false;//【支援】关位可选flg
                        bSupNullFlg = false;//【支援】空位可选flg
                        break;

                    case 7://From: 7:【支援】人员
                        bPlistFlg = true;//【考勤】工种可选flg
                        bPerFlg = true;//【考勤】标配关位可选flg
                        bPerNullFlg = true;//【考勤】空位可选flg
                        bProFlg = false;//【未定义】关位可选flg
                        bProNullFlg = false;//【未定义】空位可选flg
                        bSupFlg = false;//【支援】关位可选flg
                        bSupNullFlg = false;//【支援】空位可选flg
                        break;

                    default: break;
                }
                m_Person = ObjSender as UserPerson;
                //组长不可以调出
                if (m_Person.GuanweiNM == "组长")
                {
                    return;
                }
                m_Person.BackColor = Color.Red;
                m_Person.Tag = 1;
                txtFrom.Text = m_Person.TitleName + ":" + m_Person.UserID + "," + m_Person.UserName;
                moveFromPerson = m_Person;
                txtTo.Text = "";

            }
            //from已经选择的情况,根据From,对To处理
            else
            {
                strToSelFlg = selectFlg;
                if (strFromSelFlg == 2)//From:【考勤】标配人员
                {
                    switch (strToSelFlg)
                    {//根据from选择类型,设定To的那些可选
                        case 1://From:【考勤】标配人员-->  To选择是: 1:【考勤】工种
                            m_PersonList = ObjSender as UserPersonsList;
                            //组长、班长、副班长、替关者不可以调入
                            if (m_PersonList.TitleGuanwei == "组长" || m_PersonList.TitleGuanwei == "班长"
                                || m_PersonList.TitleGuanwei == "副班长" || m_PersonList.TitleGuanwei == "替关者")
                            {
                                return;
                            }

                            m_PersonList.BackColor = Color.Red;
                            m_PersonList.Tag = 1;
                            moveToPersonList = m_PersonList;
                            txtTo.Text = moveToPersonList.TitleGuanwei;
                            moveToPersonFlg = "1";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            if (moveFromPerson.TitleName.Substring(1, 1) == "支")
                            {
                                //支援者
                                pflag = "5";//人员调动类型:支援调入
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else if (moveFromPerson.TitleName.Substring(1, 1) == "替"
                                || moveFromPerson.TitleName.Substring(0, 3) == "替关者")
                            {
                                //替关者
                                pflag = "6";//人员调动类型:替关调动
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else//非替关者
                            {
                                pflag = "3";//人员调动类型:关位调整
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = false;//结束日期

                            }
                            break;
                        case 2://From:【考勤】标配人员-->  To选择是:2:【考勤】标配人员
                            UserPerson m_Person = ObjSender as UserPerson;
                            if (m_Person.BackColor == Color.Red
                                || m_Person.GuanweiNM == "组长" || m_Person.GuanweiNM == "班长"
                                || m_Person.GuanweiNM == "副班长")//|| m_Person.GuanweiNM == "替关者"  修改日期2015-12-29
                            {//选择自己的场合,组长\副班长\班长\替关者 选择的场合,不可选择
                                return;
                            }

                            m_Person.BackColor = Color.Red;
                            m_Person.Tag = 1;
                            moveToPerson = m_Person;
                            txtTo.Text = m_Person.TitleName + ":" + m_Person.UserID + "," + m_Person.UserName;
                            moveToPersonFlg = "2";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            if (moveFromPerson.TitleName.Substring(0, 2) == "班长"
                                || moveFromPerson.TitleName.Substring(0, 3) == "副班长" || moveFromPerson.TitleName.Substring(0, 2) == "组长")
                            {
                                pflag = "6";//人员调动类型:替关调动
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else if (moveFromPerson.TitleName.Substring(1, 1) == "替"
                                || moveFromPerson.TitleName.Substring(0, 3) == "替关者")
                            {
                                pflag = "6";//人员调动类型:替关调动
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else if (moveFromPerson.TitleName.Substring(1, 1) == "支")
                            {
                                pflag = "5";//人员调动类型:支援调入
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else//非替关者
                            {
                                pflag = "3";//人员调动类型:关位调整
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = false;//结束日期
                            }

                            break;
                        case 4://From:【考勤】标配人员-->  To选择是:4:【考勤】(空位)人员

                            //设置调入数据
                            m_PersonNull = ObjSender as UserPersonNull;
                            //组长、班长、副班长、替关者不可以调入(===============================================================2015-12-04 都可以调入)
                            //if (m_PersonNull.TitleName.Substring(0, 2) == "组长" || m_PersonNull.TitleName.Substring(0, 2) == "班长"
                            //    || m_PersonNull.TitleName.Substring(0, 2) == "副班" || m_PersonNull.TitleName.Substring(0, 2) == "替关")
                            //{
                            //    return;
                            //}
                            m_PersonNull.BackColor = Color.Red;
                            m_PersonNull.Tag = 1;
                            moveToPersonNull = m_PersonNull;
                            txtTo.Text = moveToPersonNull.TitleName;
                            moveToPersonFlg = "3";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            if (moveFromPerson.TitleName.Substring(0, 2) == "班长"
                               || moveFromPerson.TitleName.Substring(0, 3) == "副班长" || moveFromPerson.TitleName.Substring(0, 2) == "组长")
                            {
                                pflag = "6";//人员调动类型:替关调动
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else if (moveFromPerson.TitleName.Substring(1, 1) == "替"
                               || moveFromPerson.TitleName.Substring(0, 3) == "替关者")
                            {
                                pflag = "6";//人员调动类型:替关调动
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else if (moveFromPerson.TitleName.Substring(1, 1) == "支")
                            {
                                pflag = "5";//人员调动类型:支援调入
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = true;//结束日期
                            }
                            else//非替关者
                            {
                                pflag = "3";//人员调动类型:关位调整
                                dtpStartDate.Enabled = true;//开始日期
                                dtpEndDate.Enabled = false;//结束日期
                            }


                            break;

                        case 6://From:【考勤】标配人员-->  To选择是:6:【未定义】(空位)人员
                            m_PersonNull = ObjSender as UserPersonNull;
                            //设置调入数据
                            if (moveFromPerson.TitleName.Substring(0, 2) == "班长" && !Common._personid.Equals(Common._Administrator))
                            {
                                return;
                            }
                            m_PersonNull.BackColor = Color.Red;
                            m_PersonNull.Tag = 1;
                            moveToPersonNull = m_PersonNull;
                            txtTo.Text = moveToPersonNull.TitleName;
                            moveToPersonFlg = "3";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            pflag = "2";//人员调动类型:人员调出
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = false;//结束日期

                            break;
                        case 8://From:【考勤】标配人员-->  To选择是:8:【支援】(空位)人员

                            //设置调入数据
                            m_PersonNull = ObjSender as UserPersonNull;
                            m_PersonNull.BackColor = Color.Red;
                            m_PersonNull.Tag = 1;
                            moveToPersonNull = m_PersonNull;
                            txtTo.Text = moveToPersonNull.TitleName;
                            moveToPersonFlg = "3";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            pflag = "4";//人员调动类型:支援调出
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = true;//结束日期

                            break;
                        default: break;
                    }
                }

                //From:【未定义】关位
                else if (strFromSelFlg == 5)
                {
                    switch (strToSelFlg)
                    {//根据from选择类型,设定To的那些可选
                        case 1://From:【未定义】关位--> TO选择是:1:【考勤】工种
                            m_PersonList = ObjSender as UserPersonsList;
                            //组长、班长、副班长、替关者不可以调入
                            if (m_PersonList.TitleGuanwei == "组长" || m_PersonList.TitleGuanwei == "班长"
                                || m_PersonList.TitleGuanwei == "副班长" || m_PersonList.TitleGuanwei == "替关者")
                            {
                                return;
                            }
                            m_PersonList.BackColor = Color.Red;
                            m_PersonList.Tag = 1;
                            moveToPersonList = m_PersonList;
                            txtTo.Text = moveToPersonList.TitleGuanwei;
                            moveToPersonFlg = "1";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            pflag = "1";//人员调动类型:人员调入
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = false;//结束日期

                            break;
                        case 2://From:【未定义】关位--> TO选择是:2:【考勤】(标配)人员
                            m_Person = ObjSender as UserPerson;

                            if (m_Person.BackColor == Color.Red
                                || m_Person.GuanweiNM.Substring(0, 2) == "组长" || m_Person.GuanweiNM.Substring(0, 2) == "班长"
                                || m_Person.GuanweiNM.Substring(0, 2) == "副班" || m_Person.GuanweiNM.Substring(0, 2) == "替关")
                            {//选择自己的场合,组长\副班长\班长\替关者 选择的场合,不可选择
                                return;
                            }
                            m_Person.BackColor = Color.Red;
                            m_Person.Tag = 1;
                            moveToPerson = m_Person;
                            txtTo.Text = m_Person.TitleName + ":" + m_Person.UserID + "," + m_Person.UserName;
                            moveToPersonFlg = "2";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            pflag = "1";//人员调动类型:人员调入
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = false;//结束日期


                            break;
                        case 4://From:【未定义】关位--> TO选择是:4:【考勤】(空位)人员

                            //设置调入数据
                            m_PersonNull = ObjSender as UserPersonNull;
                            if (m_PersonNull.TitleName.Substring(0, 2) == "组长" || m_PersonNull.TitleName.Substring(0, 2) == "班长"
                               || m_PersonNull.TitleName.Substring(0, 2) == "副班" || m_PersonNull.TitleName.Substring(0, 2) == "替关")
                            {
                                return;
                            }
                            m_PersonNull.BackColor = Color.Red;
                            m_PersonNull.Tag = 1;
                            moveToPersonNull = m_PersonNull;
                            txtTo.Text = moveToPersonNull.TitleName;
                            moveToPersonFlg = "3";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            pflag = "1";//人员调动类型:人员调入
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = false;//结束日期

                            break;
                        default: break;
                    }
                }

                //From:【支援】关位
                else if (strFromSelFlg == 7)
                {
                    //开始时间,结束时间取得
                    string str_sql = string.Format(@"select distinct StrDate,EndDate  from V_Attend_Move_i  
                                                    where 1=1 and '{0}' between StrDate and EndDate
                                                    and MoveStatus='支援调出' and UserID='{1}'   ",
                                                    dateOperDate1.EditValue.ToString(), moveFromPerson.UserID);
                    DataTable m_tbl = SysParam.m_daoCommon.GetTableInfoBySqlNoWhere(str_sql);

                    switch (strToSelFlg)
                    {//根据from选择类型,设定To的那些可选
                        case 1://From:【支援】关位--> TO选择是:1:【考勤】工种
                            m_PersonList = ObjSender as UserPersonsList;
                            //组长、班长、副班长、替关者不可以调入
                            if (m_PersonList.TitleGuanwei == "组长" || m_PersonList.TitleGuanwei == "班长"
                                || m_PersonList.TitleGuanwei == "副班长" || m_PersonList.TitleGuanwei == "替关者")
                            {
                                return;
                            }
                            m_PersonList.BackColor = Color.Red;
                            m_PersonList.Tag = 1;
                            moveToPersonList = m_PersonList;
                            txtTo.Text = moveToPersonList.TitleGuanwei;
                            moveToPersonFlg = "1";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            pflag = "5";//人员调动类型:支援调入
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = true;//结束日期
                            if (m_tbl.Rows.Count > 0)
                            {
                                dtpStartDate.EditValue = m_tbl.Rows[0]["StrDate"].ToString();//开始日期
                                dtpEndDate.EditValue = m_tbl.Rows[0]["EndDate"].ToString();//结束日期
                            }
                            break;
                        case 2://From:【支援】关位--> TO选择是:2:【考勤】(标配)人员
                            m_Person = ObjSender as UserPerson;
                            if (m_Person.BackColor == Color.Red
                               || m_Person.GuanweiNM == "组长" || m_Person.GuanweiNM == "班长"
                               || m_Person.GuanweiNM == "副班长" || m_Person.GuanweiNM == "替关者")
                            {//选择自己的场合,组长\副班长\班长\替关者 选择的场合,不可选择
                                return;
                            }
                            m_Person.BackColor = Color.Red;
                            m_Person.Tag = 1;
                            moveToPerson = m_Person;
                            txtTo.Text = m_Person.TitleName + ":" + m_Person.UserID + "," + m_Person.UserName;
                            moveToPersonFlg = "2";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull
                            pflag = "5";//人员调动类型:支援调入
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = true;//结束日期
                            if (m_tbl.Rows.Count > 0)
                            {
                                dtpStartDate.EditValue = m_tbl.Rows[0]["StrDate"].ToString();//开始日期
                                dtpEndDate.EditValue = m_tbl.Rows[0]["EndDate"].ToString();//结束日期
                            }
                            break;
                        case 4://From:【支援】关位--> TO选择是:4:【考勤】(空位)人员

                            //设置调入数据
                            m_PersonNull = ObjSender as UserPersonNull;
                            if (m_PersonNull.TitleName.Substring(0, 2) == "组长" || m_PersonNull.TitleName.Substring(0, 2) == "班长"
                               || m_PersonNull.TitleName.Substring(0, 2) == "副班" || m_PersonNull.TitleName.Substring(0, 2) == "替关")
                            {
                                return;
                            }
                            m_PersonNull.BackColor = Color.Red;
                            m_PersonNull.Tag = 1;
                            moveToPersonNull = m_PersonNull;
                            txtTo.Text = moveToPersonNull.TitleName;
                            moveToPersonFlg = "3";//1:moveToPersonList; 2:moveToPerson;3:moveToPersonNull

                            pflag = "5";//人员调动类型:支援调入
                            dtpStartDate.Enabled = true;//开始日期
                            dtpEndDate.Enabled = true;//结束日期
                            if (m_tbl.Rows.Count > 0)
                            {
                                dtpStartDate.EditValue = m_tbl.Rows[0]["StrDate"].ToString();//开始日期
                                dtpEndDate.EditValue = m_tbl.Rows[0]["EndDate"].ToString();//结束日期
                            }
                            break;

                        default: break;
                    }

                }
                bPlistFlg = false;//关位list
                bPerFlg = false;
                bPerNullFlg = false;
                bProFlg = false;//未定义
                bProNullFlg = false;//未定义
                bSupFlg = false;//支援
                bSupNullFlg = false;//支援
            }
            //this.TopMost = false;

        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取考勤人员信息一览
        /// </summary>
        protected override void GetDspDataList()
        {
            Stopwatch s = new Stopwatch();
            Program.logFlagStart(log, s, "获取考勤人员信息一览");
            try
            {
                //this.TopMost = false;
                row_Cnt = -1;//布局行号归零
                m_tblDataList = new DataTable();//人员考勤情况数据
                m_tblGuanweiList = new DataTable();//关位信息
                //1、取得关位顺序信息
                string str_sql = string.Empty;
                str_sql = string.Format(@" SELECT a.*,  IsNull(h.InCount,0) as realityCount
                                            FROM (select CONVERT(VARCHAR(10),'{0}',120) as AttendDate,
                                                     JobForID,   ProjectID, LineID,  TeamID, myTeamName, orgTeamName,
                                                     GuanweiID, GuanweiName,  GuanweiType,  RowID, SetNum 
                                                  FROM V_Produce_Para
                                                ) AS a 
                                         LEFT  JOIN (SELECT 
                                                       a1.JobForID, a1.ProjectID, a1.LineID, a1.TeamID,  a1.GuanweiID,   a1.AttendDate, 
                                                       COUNT(*) AS InCount
                                                  FROM   (
													select JobForID, ProjectID, LineID, TeamID, GuanweiID, AttendDate,guanweisite,AttendWork,AttendType,AttendMemo  
													from V_Attend_Result_Info
												  ) AS a1 --考勤汇总报表
                                                  WHERE      a1.AttendWork > 0 AND ISNULL(a1.AttendMemo,'') <>'支援调出'
													AND a1.AttendType<>'请假' 
													AND a1.AttendType<>'欠勤' 
                                                  GROUP BY a1.JobForID, a1.ProjectID, a1.LineID, a1.TeamID, a1.GuanweiID,a1.AttendDate
                                            ) AS h 
                                               ON  a.JobForID = h.JobForID
                                               AND a.ProjectID= h.ProjectID 
                                               AND a.LineID= h.LineID 
                                               AND a.TeamID= h.TeamID 
                                               AND a.GuanweiID= h.GuanweiID
                                               AND a.AttendDate= h.AttendDate
                                       where a.myTeamName='{1}' and a.AttendDate=CONVERT(VARCHAR(10),'{2}',120)   
                                        group by RowID,a.AttendDate,a.JobForID,a.ProjectID,a.LineID,a.TeamID,a.myTeamName,a.orgTeamName,a.GuanweiID,
                                       a.GuanweiName,a.GuanweiType,a.SetNum,h.InCount order by RowID ",
                                  dateOperDate1.Text.Trim(), lookmyteamName.Text.ToString(), dateOperDate1.Text.Trim());
                m_tblGuanweiList = SysParam.m_daoCommon.GetTableInfoBySqlNoWhere(str_sql);
                if (m_tblGuanweiList.Rows.Count == 0)
                {
                    //panelContent.Controls.Clear();
                    return;
                }
                //2、人员考勤情况数据取得
                str_sql = string.Format(@"select distinct  * from V_User_TotalShow_Image WHERE 
                                                (JobForID <> 0) AND (ProjectID <> 0) 
                                                AND (LineID <> 0) AND (TeamID <> 0) 
                                                AND (GuanweiID <> 0) and ISNULL(AttendMemo,'') <>'支援调出' ");

                str_sql += " and myTeamName='" + lookmyteamName.Text.ToString() + "'";

                str_sql += " and AttendDate=CONVERT(VARCHAR(10),'" + dateOperDate1.Text.Trim() + "',120) ";
                str_sql += " order by JobForID,ProjectID,LineID,TeamID,GuanweiID,GuanweiSite ";

                m_tblDataList = SysParam.m_daoCommon.GetTableInfoBySqlNoWhere(str_sql);
                if (m_tblDataList.Rows.Count > 0)
                {
                    string TeamSetNM = m_tblDataList.Rows[0]["TeamSetNM"].ToString();
                    //设置调动开始时间、结束时间
                    if (TeamSetNM == "白班")
                    {
                        dtpStartDate.EditValue = DateTime.Now.ToString("yyyy-MM-dd") + " 08:00";
                        dtpEndDate.EditValue = DateTime.Now.ToString("yyyy-MM-dd") + " 18:00";
                    }
                    else
                    {
                        dtpStartDate.EditValue = DateTime.Now.ToString("yyyy-MM-dd") + " 22:00";
                        dtpEndDate.EditValue = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + " 07:00";
                    }

                }
                this.SuspendLayout();
                //循环把人员信息放入panel
                //panelContent.Controls.Clear();
                isLeftInto = true;//是否考勤区域处理

                xtraScrollableControl1.VerticalScroll.Value = 0;
                var isCheckCL = _lstContr2.Where(m => !m.BackColor.Equals(Color.Transparent) || !m.Tag.Equals("0")).ToList();
                foreach (Control item in isCheckCL)
                {
                    if (item.GetType().ToString() == "MachineSystem.UserControls.UserPerson")
                    {
                        item.BackColor = Color.Transparent;
                    }
                    item.Tag = "0";
                    //item.Visible = false;
                }
                _objcl2.u_gwNum = 0;
                _objcl2.u_UserPersonNum = _objcl2.gwNum;
                _objcl2.u_UserNullNum = _objcl2.gwNum + _objcl2.UserPersonNum;
                //关位
                string strGuwanweiID = string.Empty;

                var gwcount = m_tblGuanweiList.Rows.Count;
                for (int a = 0; a < gwcount; a++)
                {
                    strGuwanweiID = m_tblGuanweiList.Rows[a]["GuanweiID"].ToString();

                    //当前关位下的人员信息,关位下没有人员,不展示关位(工种)信息
                    DataView view = new DataView(m_tblDataList.Copy());
                    view.RowFilter = "GuanweiID='" + strGuwanweiID + "'";

                    DataTable dt_temp = view.ToTable();

                    //添加关位(工种)
                    m_PersonList = (UserPersonsList)_lstContr2[_objcl2.u_gwNum]; //new UserPersonsList();
                    _objcl2.u_gwNum++;

                    m_PersonList.TitleGuanwei = m_tblGuanweiList.Rows[a]["GuanweiName"].ToString();//关位名称
                    m_PersonList.GuanweiID = m_tblGuanweiList.Rows[a]["GuanweiID"].ToString();
                    bpCnt = int.Parse(m_tblGuanweiList.Rows[a]["SetNum"].ToString());

                    m_PersonList.StandardCount = bpCnt;//关位标配人数
                    m_PersonList.RealCount = int.Parse(m_tblGuanweiList.Rows[a]["realityCount"].ToString());//关位实配人数
                    try
                    {
                        m_PersonList.AllEventClick -= new UserPersonsList.AllEvent(m_PersonList_AllEventClick);
                    }
                    catch (Exception ex)
                    {
                        log.Error("AllEventClick Error:" + m_Person.UserID);
                    }
                    m_PersonList.AllEventClick += new UserPersonsList.AllEvent(m_PersonList_AllEventClick);
                    this.setImgIndex(true);//设置显示位置
                    //panelContent.Controls.Add(m_PersonList);//展示空间
                    m_PersonList.Location = _point;//设置空间展示坐标
                    if (!m_PersonList.Visible)
                    {
                        Program._frmMain.Invoke(new Action(delegate()
                        {
                            Application.DoEvents();
                            m_PersonList.Visible = true;
                        }));
                    }

                    gwShowSite = 1;
                    view = new DataView(dt_temp.Copy());
                    view.RowFilter = "GuanweiSite='99'";
                    int intCount = bpCnt + view.ToTable().Rows.Count;
                    for (int i = 0; i < intCount; i++)
                    {
                        Boolean perFlg = true;
                        int GwSite = 0;
                        if (dt_temp.Rows.Count > 0)
                        {
                            GwSite = int.Parse(dt_temp.Rows[0]["GuanweiSite"].ToString());//关位位置
                        }
                        while (GwSite == (i + 1))
                        {
                            //人员信息
                            m_Person = (UserPerson)_lstContr2[_objcl2.u_UserPersonNum];
                            _objcl2.u_UserPersonNum++; //new UserPerson();

                            perFlg = false;
                            //位置相同
                            m_Person.TitleName = dt_temp.Rows[0]["GuanweiNM"].ToString() + " - " + GwSite;

                            if (dt_temp.Rows[0]["AttendType"].ToString() == "支援")
                            {
                                m_Person.TitleName = "(支)" + dt_temp.Rows[0]["GuanweiNM"].ToString() + " - " + GwSite;
                            }
                            if (dt_temp.Rows[0]["AttendType"].ToString() == "替关")
                            {
                                m_Person.TitleName = "(替)" + dt_temp.Rows[0]["GuanweiNM"].ToString() + " - " + GwSite;
                            }

                            m_Person.GuanweiID = dt_temp.Rows[0]["GuanweiID"].ToString();
                            m_Person.GuanweiNM = dt_temp.Rows[0]["GuanweiNM"].ToString();
                            m_Person.GuanweiSite = GwSite.ToString();
                            m_Person.GuanweiColor = dt_temp.Rows[0]["GuanweiColor"].ToString();
                            m_Person.Status = dt_temp.Rows[0]["StatusName"].ToString();
                            m_Person.StatusColor = dt_temp.Rows[0]["StatusColor"].ToString();
                            m_Person.Time = dt_temp.Rows[0]["CardTime"].ToString();
                            m_Person.TimeColor = dt_temp.Rows[0]["CardTimeColor"].ToString();
                            m_Person.Remind = dt_temp.Rows[0]["warnMemo"].ToString();
                            m_Person.RemindColor = dt_temp.Rows[0]["warnColor"].ToString();
                            m_Person.LicenseType = dt_temp.Rows[0]["LicenseType"].ToString();
                            m_Person.LicenseColor = dt_temp.Rows[0]["LicenseColor"].ToString();
                            m_Person.UserID = dt_temp.Rows[0]["UserID"].ToString();
                            m_Person.UserName = dt_temp.Rows[0]["UserNM"].ToString();
                            m_Person.UserIdNmColor = dt_temp.Rows[0]["UserIdColor"].ToString();
                            m_Person.Tag = "0";
                            try
                            {
                                m_Person.AllEventClick -= new UserPerson.AllEvent(m_Person_AllEventClick);
                                m_Person.DoubleClick -= new UserPerson.DoubleEvent(m_Person_DoubleClick);
                            }
                            catch (Exception ex)
                            {
                                log.Error("AllEventClick Error:" + m_Person.UserID);
                            }
                            m_Person.AllEventClick += new UserPerson.AllEvent(m_Person_AllEventClick);
                            m_Person.ImageUrl = GridCommon.GetUserImage(SysParam.m_daoCommon, dt_temp.Rows[0]["UserID"].ToString());
                            m_Person.DoubleClick += new UserPerson.DoubleEvent(m_Person_DoubleClick);
                            this.setImgIndex(false);//设置显示位置

                            //panelContent.Controls.Add(m_Person);//展示空间
                            m_Person.Location = _point;//设置空间展示坐标
                            if (!m_Person.Visible)
                            {
                                Program._frmMain.Invoke(new Action(delegate()
                                {
                                    Application.DoEvents();
                                    m_Person.Visible = true;
                                }));
                            }
                            gwShowSite = GwSite + 1;
                            dt_temp.Rows[0].Delete();
                            if (dt_temp.Rows.Count > 0)
                            {
                                GwSite = int.Parse(dt_temp.Rows[0]["GuanweiSite"].ToString());//关位位置
                            }
                            else
                            {
                                break;
                            }
                        }


                        if (perFlg && GwSite == 99 && gwShowSite > bpCnt)
                        {
                            m_Person = (UserPerson)_lstContr2[_objcl2.u_UserPersonNum];
                            _objcl2.u_UserPersonNum++; //new UserPerson();

                            //位置相同

                            m_Person.TitleName = dt_temp.Rows[0]["GuanweiNM"].ToString() + " - " + gwShowSite.ToString();

                            if (dt_temp.Rows[0]["AttendType"].ToString() == "支援")
                            {
                                m_Person.TitleName = "(支)" + dt_temp.Rows[0]["GuanweiNM"].ToString() + " - " + gwShowSite.ToString();
                            }
                            if (dt_temp.Rows[0]["AttendType"].ToString() == "替关")
                            {
                                m_Person.TitleName = "(替)" + dt_temp.Rows[0]["GuanweiNM"].ToString() + " - " + gwShowSite.ToString();
                            }

                            m_Person.GuanweiID = dt_temp.Rows[0]["GuanweiID"].ToString();
                            m_Person.GuanweiNM = dt_temp.Rows[0]["GuanweiNM"].ToString();
                            m_Person.GuanweiSite = GwSite.ToString();
                            m_Person.GuanweiColor = dt_temp.Rows[0]["GuanweiColor"].ToString();
                            m_Person.Status = dt_temp.Rows[0]["StatusName"].ToString();
                            m_Person.StatusColor = dt_temp.Rows[0]["StatusColor"].ToString();
                            m_Person.Time = dt_temp.Rows[0]["CardTime"].ToString();
                            m_Person.TimeColor = dt_temp.Rows[0]["CardTimeColor"].ToString();
                            m_Person.Remind = dt_temp.Rows[0]["warnMemo"].ToString();
                            m_Person.RemindColor = dt_temp.Rows[0]["warnColor"].ToString();
                            m_Person.LicenseType = dt_temp.Rows[0]["LicenseType"].ToString();
                            m_Person.LicenseColor = dt_temp.Rows[0]["LicenseColor"].ToString();
                            m_Person.UserID = dt_temp.Rows[0]["UserID"].ToString();
                            m_Person.UserName = dt_temp.Rows[0]["UserNM"].ToString();
                            m_Person.UserIdNmColor = dt_temp.Rows[0]["UserIdColor"].ToString();
                            m_Person.Tag = "0";
                            m_Person.AllEventClick += new UserPerson.AllEvent(m_Person_AllEventClick);
                            m_Person.ImageUrl = GridCommon.GetUserImage(SysParam.m_daoCommon, dt_temp.Rows[0]["UserID"].ToString());
                            m_Person.DoubleClick += new UserPerson.DoubleEvent(m_Person_DoubleClick);
                            this.setImgIndex(false);//设置显示位置

                            //panelContent.Controls.Add(m_Person);//展示空间
                            m_Person.Location = _point;//设置空间展示坐标
                            if (!m_Person.Visible)
                            {
                                Program._frmMain.Invoke(new Action(delegate()
                                {
                                    Application.DoEvents();
                                    m_Person.Visible = true;
                                }));
                            }

                            gwShowSite++;
                            dt_temp.Rows[0].Delete();
                        }
                        else if (perFlg)
                        {
                            //位置不同,显示空关位
                            //人员信息
                            m_PersonNull = (UserPersonNull)_lstContr2[_objcl2.u_UserNullNum];
                            _objcl2.u_UserNullNum++;

                            m_PersonNull.TitleName = m_tblGuanweiList.Rows[a]["GuanweiName"].ToString() + " - " + gwShowSite;
                            m_PersonNull.GuanweiID = m_tblGuanweiList.Rows[a]["GuanweiID"].ToString();
                            m_PersonNull.GuanweiNM = m_tblGuanweiList.Rows[a]["GuanweiName"].ToString();
                            m_PersonNull.GuanweiSite = gwShowSite.ToString();

                            m_PersonNull.Tag = "0";
                            m_PersonNull.AllEventClick += new UserPersonNull.AllEvent(m_PersonNull_AllEventClick);
                            m_PersonNull.ImageUrl = "";
                            this.setImgIndex(false);//设置显示位置

                            //panelContent.Controls.Add(m_PersonNull);//展示空间
                            m_PersonNull.Location = _point;//设置空间展示坐标

                            if (!m_PersonNull.Visible)
                            {
                                Program._frmMain.Invoke(new Action(delegate()
                                {
                                    Application.DoEvents();
                                    m_PersonNull.Visible = true;
                                }));
                            }
                            gwShowSite++;

                        }

                    }
                }
                wid_Left_Cnt = 1;
                wid_Right_Cnt = 1;


                #region hide no use control
                //未使用的不显示
                if (_oldUsedObj.gwNum <= 0)
                {
                    _oldUsedObj.gwNum = _objcl2.gwNum;
                    _oldUsedObj.u_gwNum = _objcl2.u_gwNum;
                    _oldUsedObj.UserPersonNum = _objcl2.UserPersonNum;
                    _oldUsedObj.u_UserPersonNum = _objcl2.u_UserPersonNum;
                    _oldUsedObj.UserNullNum = _objcl2.UserNullNum;
                    _oldUsedObj.u_UserNullNum = _objcl2.u_UserNullNum;
                }
                else
                {
                    //关位
                    if (_oldUsedObj.u_gwNum >= _objcl2.u_gwNum)
                    {
                        for (int i = _objcl2.u_gwNum; i <= _oldUsedObj.u_gwNum; i++)
                        {
                            _lstContr2[i].Visible = false;
                        }
                    }
                    else
                    {
                        _oldUsedObj.u_gwNum = _objcl2.u_gwNum;
                    }
                    //人员
                    if (_oldUsedObj.u_UserPersonNum >= _objcl2.u_UserPersonNum)
                    {
                        for (int i = _objcl2.u_UserPersonNum; i <= _oldUsedObj.u_UserPersonNum; i++)
                        {
                            _lstContr2[i].Visible = false;
                        }
                    }
                    else
                    {
                        _oldUsedObj.u_UserPersonNum = _objcl2.u_UserPersonNum;
                    }
                    //空位
                    if (_oldUsedObj.u_UserNullNum >= _objcl2.u_UserNullNum)
                    {
                        for (int i = _objcl2.u_UserNullNum; i <= _oldUsedObj.u_UserNullNum; i++)
                        {
                            _lstContr2[i].Visible = false;
                        }
                    }
                    else
                    {
                        _oldUsedObj.u_UserNullNum = _objcl2.u_UserNullNum;
                    }

                }


                #endregion
                this.ResumeLayout(false);
                this.PerformLayout();
            }
            catch (Exception ex)
            {

                FrmAttendDialog FrmDialog = new FrmAttendDialog("考勤数据加载失败!" + ex);
                FrmDialog.ShowDialog();
            }
            finally
            {
                Program.logFlagEnd(log, s, "获取考勤人员信息一览");
                this.TopMost = true;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取支援的人员
        /// </summary>
        public void GetSupportList()
        {
            Stopwatch s = new Stopwatch();
            Program.logFlagStart(log, s, "获取支援的人员");
            try
            {
                this.SuspendLayout();

                //this.TopMost = false;
                panelSupport.Controls.Clear(); //JobForID,ProjectID,LineID,TeamID
                //panelSupport.AutoScroll = false;

                string str_sql = string.Empty;
                if (m_tblAllList.Rows.Count == 0)
                {
                    str_sql = string.Format(@"select distinct JobForID,ProjectID,LineID,TeamID from V_Produce_Para where myTeamName='{0}' order by JobForID,ProjectID,LineID,TeamID", lookmyteamName.Text.Trim());
                    m_tblAllList = SysParam.m_daoCommon.GetTableInfoBySqlNoWhere(str_sql);
                    if (m_tblAllList.Rows.Count == 0)
                    {

                        panelSupport.Controls.Clear();

                        return;
                    }
                }

                str_sql = string.Format(@"select distinct  *  from V_Attend_Support  where 1=1 and AttendMemo LIKE '%支援调出%'  ");

                if (txtSupportID.Text.Trim() != "")
                {
                    str_sql += " and UserID like'%" + txtSupportID.Text.Trim() + "%'";
                }
                str_sql += " and AttendDate=convert(varChar(10),'" + dateOperDate1.EditValue.ToString() + "',120)";
                //str_sql += " order by AttendMemo ,t1.UserID ";//2015-11-23

                m_tblSupportList = SysParam.m_daoCommon.GetTableInfoBySqlNoWhere(str_sql);
                //循环把人员信息放入panel
                Point _point;//控件坐标
                int lint_Left = 0;//左边距
                int lint_Top = 0;//上边距
                int lint_TopCount = 0;//当前Top有几行
                //if (m_tblDataList.Rows.Count == 0) return;//2015-11-23
                var tmpcount = m_tblSupportList.Rows.Count;


                var listCL = new Control[tmpcount + 1];

                panelSupport.Width = 2 * (m_Person.Width + 15);
                panelSupport.Height = ((tmpcount + 5) / 2) * m_Person.Height;

                for (int i = 0; i < tmpcount; i++)
                {
                    //if (i % 2 == 0 && i != 0)
                    //{
                    //    lint_TopCount++;
                    //    lint_Left = 0;
                    //}
                    //人员信息
                    m_Person = new UserPerson();
                    m_Person.Name = ("person" + (i + 1)).ToString();
                    Color cl = Color.FromName(m_tblSupportList.Rows[i]["warnColor"].ToString());
                    m_Person.TitleName = "(支)-" + m_tblSupportList.Rows[i]["GuanweiNM"].ToString();
                    m_Person.lblTitle.BackColor = cl;
                    if (m_tblSupportList.Rows[i]["AttendMemo"].ToString() == "支援调入")
                    {
                        //已经调入:绿色,不可选择
                        m_Person.GuanweiColor = GreenColor;
                    }
                    else
                    {
                        //已经调出:黄色,不可选择
                        m_Person.GuanweiColor = YellowColor;
                    }

                    m_Person.GuanweiID = m_tblSupportList.Rows[i]["GuanweiID"].ToString();
                    m_Person.GuanweiNM = m_tblSupportList.Rows[i]["GuanweiNM"].ToString();
                    m_Person.Status = m_tblSupportList.Rows[i]["StatusName"].ToString();
                    m_Person.StatusColor = m_tblSupportList.Rows[i]["StatusColor"].ToString();
                    m_Person.Time = m_tblSupportList.Rows[i]["CardTime"].ToString();
                    m_Person.TimeColor = m_tblSupportList.Rows[i]["CardTimeColor"].ToString();
                    m_Person.Remind = m_tblSupportList.Rows[i]["AttendMemo"].ToString().Substring(2, 2);//支援调入,支援调出
                    m_Person.JobForID = m_tblSupportList.Rows[i]["JobForID"].ToString();
                    m_Person.ProjectID = m_tblSupportList.Rows[i]["ProjectID"].ToString();
                    m_Person.LineID = m_tblSupportList.Rows[i]["LineID"].ToString();

                    m_Person.RemindColor = m_tblSupportList.Rows[i]["warnColor"].ToString();
                    m_Person.LicenseType = m_tblSupportList.Rows[i]["LicenseType"].ToString();
                    m_Person.LicenseColor = m_tblSupportList.Rows[i]["LicenseColor"].ToString();

                    m_Person.UserID = m_tblSupportList.Rows[i]["UserID"].ToString();
                    m_Person.UserName = m_tblSupportList.Rows[i]["UserNM"].ToString();

                    m_Person.Tag = "0";


                    m_Person.UserIdNmColor = GreenColor;
                    m_Person.Tag = "0";//选中为1,未选中为0
                    m_Person.AllEventClick += new UserPerson.AllEvent(m_Person_SupportAllEventClick);
                    m_Person.ImageUrl = GridCommon.GetUserImage(SysParam.m_daoCommon, m_tblSupportList.Rows[i]["UserID"].ToString());

                    //panelSupport.Controls.Add(m_Person);
                    //lint_Top = lint_TopCount * m_Person.Height;
                    //_point = new Point(lint_Left + 10, lint_Top + 10);
                    //lint_Left = m_Person.Width;
                    //m_Person.Location = _point;
                    Program._frmMain.Invoke(new Action(delegate()
                         {
                             Application.DoEvents();
                             m_Person.Visible = true;
                         }));

                    listCL[i] = m_Person;
                }

                //if (m_tblSupportList.Rows.Count % 2 == 0 && m_tblSupportList.Rows.Count != 0)
                //{
                //    lint_TopCount++;
                //    lint_Left = 0;
                //}
                //人员信息
                m_PersonNull = new UserPersonNull();
                m_PersonNull.Name = ("person" + m_tblSupportList.Rows.Count + 1).ToString();
                m_PersonNull.TitleName = "支援调出";
                m_PersonNull.Tag = "0";//选中为1,未选中为0
                m_PersonNull.GuanweiColor = YellowColor;
                m_PersonNull.UserIdNmColor = GreenColor;
                m_PersonNull.AllEventClick += new UserPersonNull.AllEvent(m_SupperNull_AllEventClick);
                m_PersonNull.ImageUrl = "";

                Program._frmMain.Invoke(new Action(delegate()
                {
                    Application.DoEvents();
                    m_PersonNull.Visible = true;

                }));
                listCL[tmpcount] = m_PersonNull;

                //panelSupport.Controls.Add(m_PersonNull);
                //lint_Top = lint_TopCount * m_PersonNull.Height;
                //_point = new Point(lint_Left + 10, lint_Top + 5);
                //m_PersonNull.Location = _point;

                panelSupport.Controls.AddRange(listCL);

                this.ResumeLayout(false);
                this.PerformLayout();


            }
            catch (Exception ex)
            {

                FrmAttendDialog FrmDialog = new FrmAttendDialog("支援数据检索失败!" + ex);
                FrmDialog.ShowDialog();
                log.Error(ex);

            }
            finally
            {

                //panelSupport.AutoScroll = true;

                Program.logFlagEnd(log, s, "获取支援的人员");
                this.TopMost = true;

            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取系统中未定义人员
        /// </summary>
        public void GetDspProductList()
        {
            Stopwatch s = new Stopwatch();
            Program.logFlagStart(log, s, "获取系统中未定义人员");
            try
            {

                this.SuspendLayout();

                //this.TopMost = false;

                panelProduct.Controls.Clear();
                //panelProduct.AutoScroll = false;

                string str_sql = "";
                if (m_tblAllList.Rows.Count == 0)
                {
                    str_sql = string.Format(@"select distinct JobForID,ProjectID,LineID,TeamID from V_Produce_Para where myTeamName='{0}' order by JobForID,ProjectID,LineID,TeamID", lookmyteamName.Text.Trim());
                    m_tblAllList = SysParam.m_daoCommon.GetTableInfoBySqlNoWhere(str_sql);
                    if (m_tblAllList.Rows.Count == 0)
                    {

                        panelProduct.Controls.Clear();
                        return;
                    }
                }
                str_sql = string.Format(@"select distinct TOP 20 
	                                        UserID,UserName  
                                        from V_Produce_User
	                                        where JobForID ='0' and ProjectID ='0'
                                            and LineID ='0' and TeamID='0' and GuanweiID='0'
                                            and User_Status='在职' 
                                            and UserID not in( 
		                                        select UserID
		                                        from Attend_Move
		                                        where
			                                        PFlag=2--人员调出
			                                        group by UserID 
			                                        having max(StrDate)>convert(VARCHAR(16),'{0}',120) 
                                            )", dateOperDate1.Text.Trim());

                if (txtProductUserID.Text.Trim() != "")
                {
                    str_sql += " and UserID like'%" + txtProductUserID.Text.Trim() + "%'";
                }
                str_sql += "  order by UserID";
                m_tblProduceList = SysParam.m_daoCommon.GetTableInfoBySqlNoWhere(str_sql);
                Point _point;//控件坐标
                int lint_Left = 0;//左边距
                int lint_Top = 0;//上边距
                int lint_TopCount = 0;//当前Top有几行

                var tmpcount = m_tblProduceList.Rows.Count;
                panelProduct.Width = 2 * (m_Person.Width + 15);
                panelProduct.Height = ((tmpcount + 5) / 2) * m_Person.Height;
                Control[] tmpCl = new Control[tmpcount + 1];
                for (int i = 0; i < tmpcount; i++)
                {
                    //if (i % 2 == 0 && i != 0)
                    //{
                    //    lint_TopCount++;
                    //    lint_Left = 0;
                    //}
                    //人员信息
                    m_Person = new UserPerson();
                    m_Person.Name = ("person_" + (i + 1)).ToString();
                    m_Person.TitleName = "未定义人员";

                    m_Person.UserID = m_tblProduceList.Rows[i]["UserID"].ToString();
                    m_Person.UserName = m_tblProduceList.Rows[i]["UserName"].ToString();
                    m_Person.GuanweiColor = YellowColor;
                    m_Person.UserIdNmColor = GreenColor;
                    m_Person.Tag = "0";//选中为1,未选中为0
                    m_Person.AllEventClick += new UserPerson.AllEvent(m_Person_ProductAllEventClick);
                    m_Person.ImageUrl = GridCommon.GetUserImage(SysParam.m_daoCommon, m_tblProduceList.Rows[i]["UserID"].ToString());

                    tmpCl[i] = m_Person;
                    //panelProduct.Controls.Add(m_Person);

                    //lint_Top = lint_TopCount * m_Person.Height;
                    //_point = new Point(lint_Left + 10, lint_Top + 5);
                    //m_Person.Location = _point;

                    //lint_Left += m_Person.Width + 5;
                }

                //if (m_tblProduceList.Rows.Count % 2 == 0 && m_tblProduceList.Rows.Count != 0)
                //{
                //    lint_TopCount++;
                //    lint_Left = 0;
                //}

                //未定义-人员信息空位

                m_PersonNull = new UserPersonNull();
                m_PersonNull.Name = ("person_" + m_tblProduceList.Rows.Count + 1).ToString(); ;
                m_PersonNull.TitleName = "未定义人员";
                m_PersonNull.GuanweiColor = YellowColor;
                m_PersonNull.UserIdNmColor = GreenColor;
                m_PersonNull.Tag = "0";
                m_PersonNull.AllEventClick += new UserPersonNull.AllEvent(m_ProjectNull_AllEventClick);
                m_PersonNull.ImageUrl = "";

                tmpCl[tmpcount] = m_PersonNull;

                //panelProduct.Controls.Add(m_PersonNull);

                //lint_Top = lint_TopCount * m_PersonNull.Height;
                //_point = new Point(lint_Left + 10, lint_Top + 5);
                //m_PersonNull.Location = _point;

                Program._frmMain.Invoke(new Action(delegate()
                {
                    Application.DoEvents();
                    panelProduct.Controls.AddRange(tmpCl);
                }));

                this.TopMost = true;
                this.ResumeLayout(false);
                this.PerformLayout();

                btnCanel_Click(null, null);
            }
            catch (Exception ex)
            {

                FrmAttendDialog FrmDialog = new FrmAttendDialog("未定义数据检索失败!" + ex);
                FrmDialog.ShowDialog();
                log.Error(ex);
                //panelProduct.AutoScroll = true;

            }
            finally
            {
                Program.logFlagEnd(log, s, "获取系统中未定义人员");
            }
        }