Пример #1
0
        public CSUser(string userID)
        {
            this._ID = userID;
            DataTable userDetails = DL_User.getUserDetails(userID);

            if (userDetails == null)
            {
                this._isValid = false;
            }
            else if (userDetails.Rows.Count < 1)
            {
                this._isValid = false;
            }
            else if (userDetails.Rows.Count > 1)
            {
                ///TODO:logit.
                this._isValid = false;
            }
            else
            {
                this._isValid = true;
                DataRow dr = userDetails.Rows[0];
                this._ID              = dr["UserID"].ToString();
                this._name            = dr["Name"].ToString();
                this._newMessageCount = 0;
                this._labLocation     = dr["LabID"].ToString();
                this._isCSUser        = (dr["IsCSUser"].ToString() == "Y");
                this._roleID          = "TestData_Role1";
                this._isSupervisor    = (dr["IsSupervisor"].ToString() == "Y");
                this._userEmail       = dr["UserEmail"].ToString();
                this._userIsActive    = (dr["IsActive"].ToString() == "Y");
                this._userDispName    = dr["UserDispName"].ToString();
                this._isSuperUser     = (dr["IsSuperUser"].ToString() == "Y");
            }
        }
Пример #2
0
        public CSUser(String userID, String password, String passwordExpiryPeriod)
        {
            this._ID = userID;
            string retVal = DL_User.validateUserLogin(userID, password, passwordExpiryPeriod);

            string[] arrMsg  = retVal.Split(new char[] { '^' });
            string   strCode = arrMsg[0];

            if (strCode == "0")
            {
                string   strMsg  = arrMsg[1];
                string[] arrData = strMsg.Split(new char[] { '~' });
                this._isValid                 = true;
                this._ID                      = arrData[0];
                this._name                    = arrData[1];
                this._newMessageCount         = 0;
                this._labLocation             = arrData[2];
                this._isCSUser                = (arrData[3] == "Y");
                this._roleID                  = "TestData_Role1";
                this._isSupervisor            = (arrData[4] == "Y");
                this._consultantID            = arrData[5];
                this._canChangeClientPassword = (arrData[6] == "Y");
                this._isLabC                  = (arrData[7] == "Y");
                this._userEmail               = arrData[8];
                this._userIsActive            = (arrData[9] == "Y");
                this._userDispName            = arrData[10];
                this._isSuperUser             = (arrData[11] == "Y");
                this._returnMessage           = "Successful";
            }
            else
            {
                this._isValid       = false;
                this._returnMessage = retVal;
            }
        }
Пример #3
0
        public static void getUserAlerts(String userId, out int unreadMailCount, out bool hasPendingCallBack)
        {
            string strUserAlerts = DL_User.getUserAlerts(userId);

            string[] arrAlerts = strUserAlerts.Split(new char[] { Convert.ToChar(1) });

            unreadMailCount    = Convert.ToInt32(arrAlerts[0]);
            hasPendingCallBack = (arrAlerts[1] == "1" ? true : false);
        }
Пример #4
0
 public static string changeUserPassword(string userID, string oldPassword, string newPassword)
 {
     return(DL_User.changeUserPassword(userID, oldPassword, newPassword));
 }