Exemple #1
0
        public DataTable GetHrRightApply(string clientJsonQuery)
        {
            DataTable dt = new DataTable();

            dt.TableName = "HrRightApply";

            dt.Columns.Add(new DataColumn("phid", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("rowno", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("checkstate", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("billno", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("billname", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("fillpsnid", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("fillpsnname", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("filldate", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("ischeck", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("checkpsn", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("checkdate", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("remark", Type.GetType("System.String")));

            //获取下属员工Userid,拼成字符串列表,并加上当前用户
            DataTable     underHrUseridDt = dac.GetUnderHrUserid();
            List <string> users           = new List <string>();

            for (int i = 0; i < underHrUseridDt.Rows.Count; i++)
            {
                users.Add(underHrUseridDt.Rows[i]["phid"].ToString());
            }
            users.Add(NG3.AppInfoBase.UserID.ToString());

            DataTable hrRightApplyDt = dac.GetQueryHrRightApplyDt(clientJsonQuery);
            int       rowno          = 1;

            for (int i = 0; i < hrRightApplyDt.Rows.Count; i++)
            {
                string fillpsnid = hrRightApplyDt.Rows[i]["fillpsnid"].ToString();
                if (!users.Contains(fillpsnid))
                {
                    continue;
                }

                DataRow dr = dt.NewRow();
                dr["phid"]  = hrRightApplyDt.Rows[i]["phid"];
                dr["rowno"] = rowno;
                rowno++;
                dr["checkstate"]  = hrRightApplyDt.Rows[i]["checkstate"];
                dr["ischeck"]     = hrRightApplyDt.Rows[i]["ischeck"];
                dr["billno"]      = hrRightApplyDt.Rows[i]["billno"];
                dr["billname"]    = hrRightApplyDt.Rows[i]["billname"];
                dr["fillpsnid"]   = fillpsnid;
                dr["fillpsnname"] = hrRightApplyDt.Rows[i]["fillpsnname"].ToString();
                string filldate = hrRightApplyDt.Rows[i]["filldate"].ToString();
                if (!string.IsNullOrEmpty(filldate))
                {
                    filldate       = filldate.Substring(0, filldate.IndexOf(" "));
                    filldate       = filldate.Replace("/", "-");
                    dr["filldate"] = filldate;
                }
                dr["checkpsn"] = hrRightApplyDt.Rows[i]["checkpsn"].ToString();
                string checkdate = hrRightApplyDt.Rows[i]["checkdate"].ToString();
                if (!string.IsNullOrEmpty(checkdate))
                {
                    checkdate       = checkdate.Substring(0, checkdate.IndexOf(" "));
                    checkdate       = checkdate.Replace("/", "-");
                    dr["checkdate"] = checkdate;
                }
                dr["remark"] = hrRightApplyDt.Rows[i]["remark"];
                dt.Rows.Add(dr);
            }

            return(dt);
        }