private void CheckUnitAdmin()
        {
            string sql = string.Format(@"
SELECT 
    unit.name AS unit_name
    , unit_admin.*
FROM
    $ischool.booking.equip_unit_admin AS unit_admin
    LEFT OUTER JOIN $ischool.booking.equip_units AS unit
        ON unit_admin.ref_unit_id = unit.uid
WHERE
    unit_admin.account = '{0}'
                ", Actor.UserAccount);

            DataTable dt = this._qh.Select(sql);


            foreach (DataRow row in dt.Rows)
            {
                string       unitID   = "" + row["ref_unit_id"];
                string       unitName = "" + row["unit_name"];
                DAO.UnitInfo unitRole = new DAO.UnitInfo(unitID, unitName);
                this._isUnitAdmin = true;
                this._units.Add(unitRole);
            }
        }
Example #2
0
        private void CheckUnitAdmin()
        {
            QueryHelper qh = new QueryHelper();

            string sql = string.Format(@"
SELECT 
    unit.name AS unit_name
    , unit_admin.*
FROM
    $ischool.booking.equip_unit_admin AS unit_admin
    LEFT OUTER JOIN $ischool.booking.equip_units AS unit
        ON unit_admin.ref_unit_id = unit.uid
WHERE
    unit_admin.account = '{0}'
                ", Actor.UserAccount);

            DataTable dt = qh.Select(sql);

            foreach (DataRow row in dt.Rows)
            {
                string unitID   = "" + row["ref_unit_id"];
                string unitName = "" + row["unit_name"];
                //bool isBoss = ("" + row["is_boss"]) == "true" ? true : false;
                //string teacherID = "" + row["ref_teacher_id"];
                DAO.UnitInfo unitRole = new DAO.UnitInfo(unitID, unitName);
                this._isUnitAdmin = true;

                this._units.Add(unitRole);
            }
        }