private System.Data.DataTable GetData() { var data = new UserPreferenceDataModel(); var dt = UserPreferenceDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
private void SetUpCountryDropDown() { var countryData = Framework.Components.Core.CountryDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(countryData, drpCountry, StandardDataModel.StandardDataColumns.Name, CountryDataModel.DataColumns.CountryId); var dataKey = new UserPreferenceKeyDataModel(); dataKey.Name = "UserCountry"; var dtKeys = Framework.Components.UserPreference.UserPreferenceKeyDataManager.Search(dataKey, SessionVariables.RequestProfile); if (dtKeys != null && dtKeys.Rows.Count > 0) { UserCountryKeyId = Convert.ToInt32(dtKeys.Rows[0][UserPreferenceKeyDataModel.DataColumns.UserPreferenceKeyId]); UserCountryDataTypeId = Convert.ToInt32(dtKeys.Rows[0][UserPreferenceKeyDataModel.DataColumns.DataTypeId]); var data = new UserPreferenceDataModel(); data.ApplicationUserId = SessionVariables.RequestProfile.AuditId; data.UserPreferenceKeyId = UserCountryKeyId; var dt = UserPreferenceDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count > 0) { UserCountryPreferenceId = Convert.ToInt32(dt.Rows[0][UserPreferenceDataModel.DataColumns.UserPreferenceId]); drpCountry.SelectedValue = Convert.ToString(dt.Rows[0][UserPreferenceDataModel.DataColumns.Value]); } } }
private DataTable GetData(string applicationUserId) { var data = new UserPreferenceDataModel(); data.ApplicationUserId = int.Parse(applicationUserId); var dt = UserPreferenceDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
protected override DataTable GetData() { var dt = UserPreferenceDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile); if (!string.IsNullOrEmpty(oSearchFilter.CategoryLIKE)) { var dv = dt.DefaultView; var categorylike = oSearchFilter.CategoryLIKE; if (!categorylike.EndsWith("%")) { categorylike = categorylike + "%"; } dv.RowFilter = "UserPreferenceCategory LIKE '" + categorylike + "'"; return(dv.ToTable()); } return(dt); }
private void SetUserCountry() { if (drpCountry.SelectedValue != "-1") { //UserCountryId = Convert.ToInt32(drpCountry.SelectedValue); var data = new UserPreferenceDataModel(); if (UserCountryPreferenceId != null) { data.UserPreferenceId = UserCountryPreferenceId; var dt = UserPreferenceDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count > 0) { data.UserPreferenceCategoryId = Convert.ToInt32(dt.Rows[0][UserPreferenceDataModel.DataColumns.UserPreferenceCategoryId]); data.UserPreferenceKeyId = Convert.ToInt32(dt.Rows[0][UserPreferenceDataModel.DataColumns.UserPreferenceKeyId]); data.DataTypeId = Convert.ToInt32(dt.Rows[0][UserPreferenceDataModel.DataColumns.DataTypeId]); data.Value = Convert.ToString(drpCountry.SelectedValue); data.ApplicationUserId = SessionVariables.RequestProfile.AuditId; data.ApplicationId = SessionVariables.RequestProfile.ApplicationId; UserPreferenceDataManager.Update(data, SessionVariables.RequestProfile); } } else { data.UserPreferenceCategoryId = 1; data.UserPreferenceKeyId = UserCountryKeyId; data.Value = Convert.ToString(drpCountry.SelectedValue); data.ApplicationUserId = SessionVariables.RequestProfile.AuditId; data.DataTypeId = UserCountryDataTypeId; data.ApplicationId = SessionVariables.RequestProfile.ApplicationId; UserPreferenceDataManager.Create(data, SessionVariables.RequestProfile); } var dataCountry = new CountryDataModel(); dataCountry.CountryId = Convert.ToInt32(drpCountry.SelectedValue); var dtCountry = Framework.Components.Core.CountryDataManager.Search(dataCountry, SessionVariables.RequestProfile); if (dtCountry.Rows.Count > 0) { var timeZoneId = Convert.ToInt32(dtCountry.Rows[0][CountryDataModel.DataColumns.TimeZoneId]); var dataKey = new UserPreferenceKeyDataModel(); dataKey.Name = "UserTimeZone"; var dtKeys = Framework.Components.UserPreference.UserPreferenceKeyDataManager.Search(dataKey, SessionVariables.RequestProfile); if (dtKeys != null && dtKeys.Rows.Count > 0) { var keyId = Convert.ToInt32(dtKeys.Rows[0][UserPreferenceKeyDataModel.DataColumns.UserPreferenceKeyId]); var dataTypeId = Convert.ToInt32(dtKeys.Rows[0][UserPreferenceKeyDataModel.DataColumns.DataTypeId]); data = new UserPreferenceDataModel(); data.UserPreferenceKeyId = keyId; var dt = UserPreferenceDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count > 0) { data.Value = Convert.ToString(timeZoneId); data.UserPreferenceCategoryId = Convert.ToInt32(dt.Rows[0][UserPreferenceDataModel.DataColumns.UserPreferenceCategoryId]); data.UserPreferenceId = Convert.ToInt32(dt.Rows[0][UserPreferenceDataModel.DataColumns.UserPreferenceId]); data.DataTypeId = Convert.ToInt32(dt.Rows[0][UserPreferenceDataModel.DataColumns.DataTypeId]); data.ApplicationUserId = SessionVariables.RequestProfile.AuditId; data.ApplicationId = SessionVariables.RequestProfile.ApplicationId; UserPreferenceDataManager.Update(data, SessionVariables.RequestProfile); } else { data.Value = Convert.ToString(timeZoneId); data.DataTypeId = dataTypeId; data.UserPreferenceKeyId = keyId; data.UserPreferenceCategoryId = 1; data.ApplicationUserId = SessionVariables.RequestProfile.AuditId; data.ApplicationId = SessionVariables.RequestProfile.ApplicationId; UserPreferenceDataManager.Create(data, SessionVariables.RequestProfile); } } } } }