Пример #1
0
    // get person information from WEID table
    private bool getPersonDetails()
    {
        var wdc  = new WEIDDataContext();
        var weid = wdc.WEID_DIR_PERSON_00s.Where(p => p.ENAME == Session["Ename"]).First();

        // only allow current students and all types of employees (not applicants or community members)
        Session["StudentType"]  = weid.STUDENT_TYPE ?? String.Empty;
        Session["EmployeeType"] = weid.EMPLOYEE_TYPE ?? String.Empty;
        if (!Session["StudentType"].Equals("Student") && Session["EmployeeType"].Equals(String.Empty))
        {
            return(false);
        }

        // get person contact information
        Session["Name"]  = weid.LAST_NAME + ", " + weid.FIRST_NAME + " " + weid.MIDDLE_NAME;
        Session["Phone"] = validPhone(weid.EMPLOYEE_PHONE) ?? validPhone(weid.EMPLOYEE_PHONE_2) ?? validPhone(weid.PHONE) ?? String.Empty;
        Session["Email"] = weid.PROPER_NAME_ADDRESS ?? String.Empty;
        Session["EmployeeDepartmentNumber"] = weid.EMPLOYEE_DEPARTMENT_NUMBER ?? String.Empty;
        return(true);
    }
Пример #2
0
    // get person information from WEID table
    private bool getPersonDetails()
    {
        var wdc = new WEIDDataContext();
        var weid = wdc.WEID_DIR_PERSON_00s.Where(p => p.ENAME == Session["Ename"]).First();

        // only allow current students and all types of employees (not applicants or community members)
        Session["StudentType"] = weid.STUDENT_TYPE ?? String.Empty;
        Session["EmployeeType"] = weid.EMPLOYEE_TYPE ?? String.Empty;
        if (!Session["StudentType"].Equals("Student") && Session["EmployeeType"].Equals(String.Empty))
            return false;

        // get person contact information
        Session["Name"] = weid.LAST_NAME + ", " + weid.FIRST_NAME + " " + weid.MIDDLE_NAME;
        Session["Phone"] = validPhone(weid.EMPLOYEE_PHONE) ?? validPhone(weid.EMPLOYEE_PHONE_2) ?? validPhone(weid.PHONE) ?? String.Empty;
        Session["Email"] = weid.PROPER_NAME_ADDRESS ?? String.Empty;
        Session["EmployeeDepartmentNumber"] = weid.EMPLOYEE_DEPARTMENT_NUMBER ?? String.Empty;
        return true;
    }