Example #1
0
        public DataTable GetRoleInfo(string fillpsnid, string userid, string orgid, string billno)
        {
            DataTable dt = new DataTable();

            dt.TableName = "RoleInfo";

            dt.Columns.Add(new DataColumn("rowno", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("select", Type.GetType("System.Boolean")));
            dt.Columns.Add(new DataColumn("roleid", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("roleno", Type.GetType("System.String")));
            dt.Columns.Add(new DataColumn("rolename", Type.GetType("System.String")));

            if (string.IsNullOrEmpty(fillpsnid))
            {
                fillpsnid = NG3.AppInfoBase.UserID.ToString();
            }

            DataTable userRoleOrgDt = dac.GetUserRoleOrg(string.IsNullOrEmpty(billno) ? NG3.AppInfoBase.UserID.ToString() : fillpsnid, orgid);

            for (int i = 0; i < userRoleOrgDt.Rows.Count; i++)
            {
                DataRow dr = dt.NewRow();
                dr["rowno"] = i + 1;
                string roleid = userRoleOrgDt.Rows[i]["phid"].ToString();
                if (string.IsNullOrEmpty(billno))
                {
                    dr["select"] = dac.CheckUserRoleOrg(userid, roleid, orgid);
                }
                else
                {
                    dr["select"] = dac.CheckUserRoleOrg(userid, roleid, orgid, billno);
                }
                dr["roleid"]   = roleid;
                dr["roleno"]   = userRoleOrgDt.Rows[i]["roleno"];
                dr["rolename"] = userRoleOrgDt.Rows[i]["rolename"];
                dt.Rows.Add(dr);
            }

            return(dt);
        }