Пример #1
0
        //public List<cNoifications> UserNotifications;
        //public cCalandar UserCalandar;
        //public List<LarpPortal.Classes.cCharacter> UserCharacters;


        private cUser()
        {
            UserID                   = -1;
            LoginName                = "";
            PrimaryEmailID           = -1;
            PrimaryEmailAddress      = new cEMail();
            UserEmails               = new List <cEMail>();
            LoginEmail               = "";
            LoginPassword            = "";
            SecurityRoleID           = -1;
            FirstName                = "";
            LastName                 = "";
            MiddleName               = "";
            NickName                 = "";
            ForumUserName            = "";
            AuthorName               = "";
            NotificationPreference   = -1;
            PrimaryAddressID         = -1;
            PrimaryAddress           = new cAddress();
            UserAddresses            = new List <cAddress>();
            PrimaryPhoneNumberID     = -1;
            PrimaryPhone             = new cPhone();
            UserPhones               = new List <cPhone>();
            DeliveryPreferenceID     = -1;
            LastLoggedInLocation     = "";
            UserCampaigns            = new List <cUserCampaign>();
            LastLoggedInCampaign     = 0;
            LastLoggedInCharacter    = 0;
            LastLoggedInMyCharOrCamp = "";
            LastLoggedInSkillSetID   = 0;
            XRefNumber               = -1;
            Comments                 = "";
            UserCPBank               = new cBank();
        }
Пример #2
0
        public cUser(string strLoginName, string strLoginPassword, string sSessionID)
        {
            MethodBase lmth          = MethodBase.GetCurrentMethod();
            string     lsRoutineName = lmth.DeclaringType + "." + lmth.Name;

            // JLB 5/12/2018 - Put in default values. It appeared as if the values were defaulting.
            UserID                   = -1;
            LoginName                = "";
            PrimaryEmailID           = -1;
            PrimaryEmailAddress      = new cEMail();
            UserEmails               = new List <cEMail>();
            LoginEmail               = "";
            LoginPassword            = "";
            SecurityRoleID           = -1;
            FirstName                = "";
            LastName                 = "";
            MiddleName               = "";
            NickName                 = "";
            ForumUserName            = "";
            AuthorName               = "";
            NotificationPreference   = -1;
            PrimaryAddressID         = -1;
            PrimaryAddress           = new cAddress();
            UserAddresses            = new List <cAddress>();
            PrimaryPhoneNumberID     = -1;
            PrimaryPhone             = new cPhone();
            UserPhones               = new List <cPhone>();
            DeliveryPreferenceID     = -1;
            LastLoggedInLocation     = "";
            UserCampaigns            = new List <cUserCampaign>();
            LastLoggedInCampaign     = 0;
            LastLoggedInCharacter    = 0;
            LastLoggedInSkillSetID   = 0;
            LastLoggedInMyCharOrCamp = "";                              // 5/8/2019 JLB Needed for multiple skill sets.
            XRefNumber               = -1;
            Comments                 = "";
            UserCPBank               = new cBank();

            SortedList slParams = new SortedList();

            LoginName     = strLoginName;
            LoginPassword = strLoginPassword;
            SessionID     = sSessionID;

            slParams = new SortedList();
            slParams.Add("@LoginUserName", LoginName);
            try
            {
                DataSet ldt = cUtilities.LoadDataSet("uspGetUserByLoginName", slParams, "LARPortal", LoginName, lsRoutineName);
                ldt.Tables[0].TableName = "UserInfo";
                ldt.Tables[1].TableName = "AddressInfo";
                ldt.Tables[2].TableName = "AddressType";
                ldt.Tables[3].TableName = "PhoneNumber";
                ldt.Tables[4].TableName = "PhoneType";
                ldt.Tables[5].TableName = "PhoneProviders";

                if (ldt.Tables["UserInfo"].Rows.Count > 0)
                {
                    DataRow dUserInfo = ldt.Tables["UserInfo"].Rows[0];
                    UserID                 = dUserInfo["UserID"].ToString().ToInt32();
                    PrimaryEmailID         = dUserInfo["EmailID"].ToString().ToInt32();
                    SecurityRoleID         = dUserInfo["SecurityRoleID"].ToString().ToInt32();
                    FirstName              = dUserInfo["FirstName"].ToString();
                    MiddleName             = dUserInfo["MiddleName"].ToString();
                    LastName               = dUserInfo["LastName"].ToString();
                    NickName               = dUserInfo["NickName"].ToString();
                    PrimaryPhoneNumberID   = dUserInfo["PrimaryPhoneID"].ToString().ToInt32();
                    PrimaryAddressID       = dUserInfo["PrimaryAddressID"].ToString().ToInt32();
                    ForumUserName          = dUserInfo["ForumUsername"].ToString();
                    NotificationPreference = dUserInfo["NotificationPreferenceID"].ToString().ToInt32();
                    DeliveryPreferenceID   = dUserInfo["DeliveryPreferenceID"].ToString().ToInt32();
                    LastLoggedInLocation   = dUserInfo["LastLoggedInLocation"].ToString();
                    LastLoggedInCampaign   = dUserInfo["LastLoggedInCampaign"].ToString().ToInt32();

                    LastLoggedInCharacter    = dUserInfo["LastLoggedInCharacter"].ToString().ToInt32();
                    LastLoggedInMyCharOrCamp = dUserInfo["LastLoggedInMyCharOrCamp"].ToString();
                    LastLoggedInSkillSetID   = dUserInfo["LastLoggedInSkillSetID"].ToString().ToInt32();                                    // 5/8/2019 JLB Needed for multiple skill sets.
                    XRefNumber  = dUserInfo["XRefNumber"].ToString().ToInt32();
                    DateAdded   = Convert.ToDateTime(dUserInfo["DateAdded"].ToString());
                    DateChanged = Convert.ToDateTime(dUserInfo["DateChanged"].ToString());
                }

                LoadAddresses(ldt.Tables["AddressInfo"], ldt.Tables["AddressType"], strLoginName);
                LoadPhones(ldt.Tables["PhoneNumber"], ldt.Tables["PhoneType"], ldt.Tables["PhoneProviders"]);
                LoadEmails();
            }
            catch (Exception ex)
            {
                ErrorAtServer lobjError = new ErrorAtServer();
                lobjError.ProcessError(ex, lsRoutineName, LoginName + lsRoutineName);
            }
        }