private void LoadPhones() { MethodBase lmth = MethodBase.GetCurrentMethod(); string lsRoutineName = lmth.DeclaringType + "." + lmth.Name; try { _PrimaryPhone = new cPhone(_PrimaryPhoneNumberID, _UserID, _LoginName); _UserPhones = new List <cPhone>(); SortedList slParams = new SortedList(); slParams.Add("@intKeyID", _UserID); slParams.Add("@strKeyType", "cUser"); DataTable ldt = cUtilities.LoadDataTable("uspGetPhoneNumberByKeyInfo", slParams, "LARPortal", _LoginName, lsRoutineName); if (ldt.Rows.Count > 0) { foreach (DataRow ldr in ldt.Rows) { cPhone cPh = new cPhone(ldr["PhoneNumberID"].ToString().Trim().ToInt32(), _UserID, _LoginName); _UserPhones.Add(cPh); } } } catch (Exception ex) { ErrorAtServer lobjError = new ErrorAtServer(); lobjError.ProcessError(ex, lsRoutineName, _LoginName + lsRoutineName); } }
//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(); }
public cSite(Int32 intSiteID, Int32 intUserID, string strUserName) { MethodBase lmth = MethodBase.GetCurrentMethod(); // this is where we use refelection to store the name of the method and class to use it to report errors string lsRoutineName = lmth.DeclaringType + "." + lmth.Name; _SiteID = intSiteID; _UserID = intUserID; _UserName = strUserName; //so lets say we wanted to load data into this class from a sql query called uspGetSomeData thats take two paraeters @Parameter1 and @Parameter2 SortedList slParams = new SortedList(); // I use a sortedlist wich is a C# hash table to store the paramter and value slParams.Add("@intSiteID", _SiteID); try { DataTable ldt = cUtilities.LoadDataTable("uspGetSTSitesByID", slParams, "LarpPortal", _UserName, lsRoutineName); if (ldt.Rows.Count > 0) { _SiteName = ldt.Rows[0]["SiteName"].ToString(); _SiteAddress = new cAddress(ldt.Rows[0]["AddressID"].ToString().ToInt32(), _UserName, _UserID); _SitePhone = new cPhone(ldt.Rows[0]["PhoneID"].ToString().ToInt32(), _UserID, _UserName); _URL = ldt.Rows[0]["URL"].ToString().Trim(); _SiteMapURL = ldt.Rows[0]["SiteMapURL"].ToString().Trim(); _SiteDirections = ldt.Rows[0]["SiteDirections"].ToString(); _YearRound = ldt.Rows[0]["YearRound"].ToString().ToBoolean(); _TimeRestrictions = ldt.Rows[0]["TimeRestrictions"].ToString(); _EMTCertReqd = ldt.Rows[0]["EMTCertificationRequired"].ToString().ToBoolean(); _CookCertReqd = ldt.Rows[0]["CookingCertificationRequired"].ToString().ToBoolean(); _AddWaiversReqd = ldt.Rows[0]["AdditionalWaiversRequired"].ToString().ToBoolean(); _SiteNotes = ldt.Rows[0]["SiteNotes"].ToString().Trim(); _Comments = ldt.Rows[0]["Comments"].ToString().Trim(); _DateAdded = Convert.ToDateTime(ldt.Rows[0]["DateAdded"].ToString().ToString()); _DateChanged = Convert.ToDateTime(ldt.Rows[0]["DateChanged"].ToString().ToString()); LoadSitePolicies(); LoadSiteImages(); LoadSiteContacts(); LoadSiteComments(); LoadSiteAvailabilityDates(); LoadLocations(); } } catch (Exception ex) { ErrorAtServer lobjError = new ErrorAtServer(); lobjError.ProcessError(ex, lsRoutineName, _UserName + lsRoutineName); } }
private void LoadPhones(DataTable dtPhoneNumbers, DataTable dtPhoneTypes, DataTable dtPhoneProviders) { MethodBase lmth = MethodBase.GetCurrentMethod(); string lsRoutineName = lmth.DeclaringType + "." + lmth.Name; List <cPhoneType> PhoneTypes = new List <cPhoneType>(); foreach (DataRow dRow in dtPhoneTypes.Rows) { cPhoneType NewType = new cPhoneType(); NewType.PhoneType = dRow["PhoneType"].ToString(); int iTemp; if (int.TryParse(dRow["PhoneTypeID"].ToString(), out iTemp)) { NewType.PhoneTypeID = iTemp; } if (int.TryParse(dRow["SortOrder"].ToString(), out iTemp)) { NewType.SortOrder = iTemp; } PhoneTypes.Add(NewType); } List <cPhoneProvider> Providers = new List <cPhoneProvider>(); foreach (DataRow dRow in dtPhoneProviders.Rows) { cPhoneProvider NewProv = new cPhoneProvider(); NewProv.ProviderGateway = dRow["ProviderGateway"].ToString(); NewProv.ProviderName = dRow["ProviderName"].ToString(); int iTemp; if (int.TryParse(dRow["PhoneProviderID"].ToString(), out iTemp)) { NewProv.PhoneProviderID = iTemp; } if (int.TryParse(dRow["SortOrder"].ToString(), out iTemp)) { NewProv.SortOrder = iTemp; } Providers.Add(NewProv); } UserPhones = new List <cPhone>(); foreach (DataRow dRow in dtPhoneNumbers.Rows) { cPhone NewPhone = new cPhone { IDD = dRow["IDD"].ToString(), CountryCode = dRow["CountryCode"].ToString(), AreaCode = dRow["AreaCode"].ToString(), PhoneNumber = dRow["PhoneNumber"].ToString(), Extension = dRow["Extension"].ToString(), Comments = dRow["Comments"].ToString() }; NewPhone.PhoneTypes = PhoneTypes; NewPhone.ProviderList = Providers; int iTemp; if (int.TryParse(dRow["PhoneNumberID"].ToString(), out iTemp)) { NewPhone.PhoneNumberID = iTemp; } if (int.TryParse(dRow["PhoneTypeID"].ToString(), out iTemp)) { NewPhone.PhoneTypeID = iTemp; } if (int.TryParse(dRow ["ProviderID"].ToString(), out iTemp)) { NewPhone.ProviderID = iTemp; } bool bTemp; NewPhone.IsPrimary = false; if (bool.TryParse(dRow["PrimaryPhone"].ToString(), out bTemp)) { if (bTemp) { NewPhone.IsPrimary = true; PrimaryPhone = NewPhone; PrimaryPhoneNumberID = NewPhone.PhoneNumberID; } } UserPhones.Add(NewPhone); } }
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); } }