示例#1
0
    public DataTable getTableData(string strDomain, string strCompany, string strSearch)
    {
        log.Debug("getTableData()--strDomain=" + strDomain);
        log.Debug("getTableData()--strCompany=" + strCompany);
        log.Debug("getTableData()--strSearch=" + strSearch);
        //get the record set in mainpage

        AuthorityManager authMgr = new AuthorityManager();

        //define datatable for tableedit
        DataTable dtDepts = new DataTable();
        DataColumn aDept = new DataColumn("aDept");
        DataColumn Department = new DataColumn("Department");
        DataColumn dept_path = new DataColumn("dept_path");

        dtDepts = authMgr.getDeptsByCompany(strDomain, strCompany, strSearch);

        dtDepts.Columns.Add(aDept);
        dtDepts.Columns.Add(Department);
        dtDepts.Columns.Add(dept_path);

        int dtDeptsCount = dtDepts.Rows.Count - 1;
        for (int i = dtDeptsCount; i >= 0; i--)
        {
            DataRow tmpRow = dtDepts.Rows[i];

            //Filters out any empty department's name from dtDepts
            if (tmpRow[0].ToString().Trim().Equals(""))
            {
                dtDepts.Rows.RemoveAt(i);
            }
            else
            {
                tmpRow[1] = tmpRow[0];
                tmpRow[2] = tmpRow[0];
                tmpRow[3] = strDomain + ";" + strCompany + ";" + tmpRow[0];
            }
        }
        dtDepts.Columns.Remove(Constants.TABLE_COLUMN_DEPARTMENT);
      
        return dtDepts;
    }
示例#2
0
 public DataTable getDeptsByCompany(string strDomain, string strCompany)
 {
     log.Debug("getDeptsByCompany");
     AuthorityManager authMgr = new AuthorityManager();
     DataTable dtDepts = authMgr.getDeptsByCompany(strDomain, strCompany,"");
     return dtDepts;
 }