private async void TrySave() { ProgressDialog progress; progress = new Android.App.ProgressDialog(this); progress.Indeterminate = true; progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner); progress.SetMessage("Logging In... Please wait..."); progress.SetCancelable(false); progress.Show(); CurrentPlatform.Init(); EditText firstName = (EditText)FindViewById(Resource.Id.firstName); EditText lastName = (EditText)FindViewById(Resource.Id.lastName); EditText email = (EditText)FindViewById(Resource.Id.email); EditText phoneNo = (EditText)FindViewById(Resource.Id.phoneNo); Spinner gender = (Spinner)FindViewById(Resource.Id.gender); Spinner county = (Spinner)FindViewById(Resource.Id.county); UserProfiles newUserInfo = new UserProfiles { UsersID = pref.GetString("UserID", "NULL"), Firstname = firstName.Text, Lastname = lastName.Text, Email = email.Text, PhoneNo = phoneNo.Text, Gender = gender.SelectedItem.ToString(), County = county.SelectedItem.ToString() }; MobileService.GetTable <UserProfiles>().InsertAsync(newUserInfo); progress.Hide(); Toast.MakeText(ApplicationContext, "User " + pref.GetString("UserName", "NULL") + " info created!", ToastLength.Short).Show(); }
// initializes the speaker with remote voice info internal void OnVoiceLinked(int frequency, int channels, int frameSamplesPerChannel, int playDelayMs) { #if !UNITY_EDITOR && UNITY_PS4 if (frameBuf == null) { if (framePool == null) { framePool = new ExitGames.Client.Photon.Voice.PrimitiveArrayPool <float>(FRAME_POOL_CAPACITY, "PhotonVoiceSpeaker"); framePool.Init(frameSamplesPerChannel * channels); } int userID = PhotonVoiceSettings.Instance.PS4UserID; if (userID == 0) { UserProfiles.LocalUsers localUsers = new UserProfiles.LocalUsers(); UserProfiles.GetLocalUsers(localUsers); userID = localUsers.LocalUsersIds[0].UserId.Id; } pPhotonVoiceAudioOutput = egpvopen(userID, GRANULARITY, channels > 1); framer = new Framer <float>(GRANULARITY * channels); playThreadShouldTerminate = false; playThread = new Thread(Play); playThread.Name = "photon voice audio output thread"; playThread.IsBackground = true; playThread.Start(); frameBuf = new Dictionary <int, Queue <float[]> >(); } lock (frameBuf) { frameBuf.Add(GetInstanceID(), new Queue <float[]>()); } #endif this.player.Start(frequency, channels, frameSamplesPerChannel, playDelayMs); }
public async Task ComeBack(IGuildUser user) { var userProfile = UserProfiles.GetProfile(user as SocketUser); userProfile.IsMuted = false; await Context.Channel.SendMessageAsync(Vocabulary.GetFormattedText(Constants.ModerationComeBack, user.Mention)); }
public ActionResult <string> Get() { for (var i = 1; i <= 29; i++) { var pNo = i.ToString().PadLeft(2, '0'); var up = new UserProfiles(); up.Id = Guid.NewGuid(); up.LineDisplayName = "LineDisplayName" + " " + pNo; up.LinePictureUrl = "https://line/pic/" + pNo; up.LineStatusMessage = "LineStatusMessage" + " " + pNo; up.LineUserId = "LineUserId" + " " + pNo; up.OfficerEmail = "OfficerEmail" + " " + pNo; up.OfficerId = pNo; up.OfficerName = "OfficerName" + " " + pNo; up.OfficerPictureUrl = "https://officer/pic/" + pNo; up.RegisteredDateTime = DateTime.Now; up.RegisteringDateTime = DateTime.Now; up.Role = "USER"; up.Status = true; var resp = _fbObj.PutUserProfiles(up); var result = resp.Result.Content.ReadAsStringAsync().Result; } return(Ok("FINISHED")); }
public async Task <IActionResult> Edit(int id, [Bind("Iduser,Idcustomer,Name,LastName,Active")] UserProfiles userProfiles) { if (id != userProfiles.Iduser) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userProfiles); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserProfilesExists(userProfiles.Iduser)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(userProfiles)); }
public void Start(int frequency, int channels, int frameSamplesPerChannel, int playDelayMs) { const int CHANNEL_COUNT = 2; // stereo instanceFramePool = new PrimitiveArrayPool <float>(FRAME_POOL_CAPACITY, "PS4AudioOut"); instanceFramePool.Init(frameSamplesPerChannel * DEST_SAMPLE_RATE / frequency * CHANNEL_COUNT); channelCount = channels; lock (locker) { if (frameBuf == null) { staticFramePool = new PrimitiveArrayPool <float>(FRAME_POOL_CAPACITY, "PS4AudioOut"); staticFramePool.Init(GRANULARITY * CHANNEL_COUNT); int userID = PhotonVoiceSettings.Instance.PS4UserID; if (userID == 0) { UserProfiles.LocalUsers localUsers = new UserProfiles.LocalUsers(); UserProfiles.GetLocalUsers(localUsers); userID = localUsers.LocalUsersIds[0].UserId.Id; } pPhotonVoiceAudioOutput = egpvopen(userID, GRANULARITY, true); playThreadShouldTerminate = false; playThread = new Thread(Play); playThread.Name = "photon voice audio output thread"; playThread.IsBackground = true; playThread.Start(); frameBuf = new Dictionary <PS4AudioOut, Queue <float> >(); } frameBuf.Add(this, new Queue <float>()); } this.speakersOut.Start(frequency, channels, frameSamplesPerChannel, playDelayMs); }
private void btnAddProfile_Click(object sender, EventArgs e) { // Make sure the email is valid if (SGGlobals.IsEmailValid(txtDefaultAddress.Text) == false) { MessageBox.Show("Email address does not appear to be valid!", "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } // Make sure the profile doesn't exist try { UserProfiles.GetProfileByName(txtProfileName.Text); // Profile exists! MessageBox.Show("Profile name already exists!", "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } catch (ProfileNotFoundException) { // Profile does not exist, create it Profile objNewProfile = new Profile(); objNewProfile.Name = txtProfileName.Text; objNewProfile.ToAddresses.Add(txtDefaultAddress.Text); objNewProfile.Save(); this._objDialogStatus = DialogResult.OK; this.Close(); } catch (Exception ex) { MessageBox.Show("An unknown error occured creating the new profile:" + Environment.NewLine + ex.Message, "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private async Task HandleMessage(SocketMessage s) { if (!(s is SocketUserMessage msg)) { return; } if (msg.Channel is SocketDMChannel) { return; } var context = new SocketCommandContext(client, msg); if (UserProfiles.GetProfile(context.User).IsMuted) { await context.Message.DeleteAsync(); return; } if (context.Message.Content.Contains(client.CurrentUser.Mention.Replace("!", ""))) { await context.Channel.SendMessageAsync(RandomReplies.GetReply()); } }
public static void UpdateProfile(IGuild guild, ulong userId, string text) { string profiles = Helper.GetPath(guild, "profiles.json"); if (Profiles == null) { Profiles = new UserProfiles(); } bool contains = false; foreach (var uprof in Profiles.ProfilesList) { if (uprof.UserId == userId) { uprof.ProfileText = text; contains = true; break; } } if (!contains) { Profiles.ProfilesList.Add(new UserProfile(userId, text)); } File.WriteAllText(profiles, JsonConvert.SerializeObject(Profiles)); }
private async void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { var menu = new PopupMenu(this, lv.GetChildAt(e.Position - lv.FirstVisiblePosition)); menu.Inflate(Resource.Layout.SearchJourneyMenu); Journeys j = userJourneys[e.Position]; menu.MenuItemClick += async(s, a) => { switch (a.Item.ItemId) { case Resource.Id.pop_buttonSearchApply: // Add user to applicants for journey j.Applicants += pref.GetString("UserID", "") + ","; DBHelper.UpdateJourney(j); UserProfiles up = await DBHelper.GetUsersProfile(j.DriverID); DBHelper.SendApplicationNoticeEmail(up.Email, j); StartActivity(typeof(MainProfileActivity)); break; case Resource.Id.pop_buttonSearchView: edit.PutString("SelectedJourneyID", j.ID); edit.Commit(); StartActivity(typeof(ShowJourney)); break; } }; menu.Show(); }
/// <summary> /// Populates the selected profile and closes the form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Click(object sender, EventArgs e) { // Make sure they have selected a profile if (cboProfile.Text.Equals("")) { MessageBox.Show("Please select a valid profile", "Select Profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } // Set the selected profile this._objSelectedProfile = UserProfiles.GetProfileByName(cboProfile.Text); // Set the reporting action if (radSpam.Checked == true) { this._enumAction = SGGlobals.ReportAction.ReportSpam; } else { this._enumAction = SGGlobals.ReportAction.ReportHam; } // Set dialog result this.DialogResult = DialogResult.OK; // Close the form this.Close(); }
public async Task <IActionResult> EditProfile(int id, [Bind("Id,FirstName,LastName,DisplayName,DateCreated,UserTypeId,UserAccountId")] UserProfiles userProfiles) { if (id != userProfiles.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userProfiles); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserProfilesExists(userProfiles.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UserTypeId"] = new SelectList(_context.UserType, "Id", "TypeName", userProfiles.UserTypeId); return(View(userProfiles)); }
public void Write() { Logger.LogDebug("SettingsService", "Writing settings to disk"); var profiles = UserProfiles.ToDictionary(profile => profile.Id, profile => profile.Name); var configFile = new ConfigFile { ApplicationSettings = ApplicationSettings, DefaultProfileId = DefaultProfileId, Profiles = profiles, Servers = Servers }; try { //If no config directory exists, create it if (!_fileAccessor.DirectoryExists(ApplicationConfig.ConfigPath)) { _fileAccessor.CreateDirectory(ApplicationConfig.ConfigPath); } _fileAccessor.WriteAllText(Path.Combine(ApplicationConfig.ConfigPath, ApplicationConfig.ConfigFileName), JsonConvert.SerializeObject(configFile, ApplicationConfig.JsonFormatting)); } catch (Exception e) { Logger.LogException("SettingsService", "Error writing settings", e); } }
private void btnDeleteProfile_Click(object sender, EventArgs e) { if (lbProfiles.SelectedIndex > -1) { // Make sure they are sure! if (MessageBox.Show("Are you sure you want to delete this profile?" + Environment.NewLine + "This cannot be undone!", "SpamGrabber", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { // See if this was one of the defaults Profile objProfile = UserProfiles.GetProfileByName(GetSelectedProfileName()); if (GlobalSettings.DefaultSpamProfileId.Equals(objProfile.Id)) { GlobalSettings.DefaultSpamProfileId = string.Empty; GlobalSettings.ResetDefaultProfile(GlobalSettings.DefaultType.Spam); } if (GlobalSettings.DefaultHamProfileId.Equals(objProfile.Id)) { GlobalSettings.DefaultHamProfileId = string.Empty; GlobalSettings.ResetDefaultProfile(GlobalSettings.DefaultType.Ham); } // Delete the profile UserProfiles.DeleteProfile(objProfile.Name); // Clear all required caches and fire update event UserProfiles.ClearProfileCache(); PopulateList(); ProfileListChanged(this); } } }
public void UpsertUserProfile(UserProfile user) { Debug.Assert(!this.m_readOnly, "Configuration in use is read-only. Did you forget BeginCachedConfiguration?"); if (user.UniqueId.Length == 0) { user.UniqueId = Guid.NewGuid().ToString(); // Clone the user and add to the configuration's UserProfile dictionary UserProfiles.Add(user.UniqueId, (UserProfile)user.Clone()); _logger.LogInformation($"User {user.Name} added."); } else { Debug.Assert(UserProfiles.ContainsKey(user.UniqueId), "User profile not found in dictionary. Cannot update."); // Clone the user and update the configuration's UserProfile dictionary UserProfiles[user.UniqueId] = (UserProfile)user.Clone(); _logger.LogInformation($"User {user.Name} updated."); } // The Default property is included on the profile just as a helper (it's not saved in the json). // What is saved is the UniqueId of the default user in the DefaultUserProfile field. if (user.Default) { DefaultUserProfile = user.UniqueId; } else if (DefaultUserProfile == user.UniqueId) { DefaultUserProfile = ""; } }
private void ManageProfilesControl_EditProfileRaised(object sender) { // Show / hide the controls UIControl.StopWindowUpdating(this.Handle); generalOptions.Visible = false; about.Visible = false; submissionControl.Visible = true; ManageProfilesControl.Visible = false; // Populate the settings control submissionControl.Profile = UserProfiles.GetProfileByName(ManageProfilesControl.SelectedProfile); // Select the item in the treeview TreeNode objSelectedProfile = null; foreach (TreeNode objNode in tvwOptions.Nodes["ndeProfiles"].Nodes) { if (objNode.Text.Equals(ManageProfilesControl.SelectedProfile)) { objSelectedProfile = objNode; } } if (objSelectedProfile != null) { tvwOptions.SelectedNode = objSelectedProfile; } // Cache the loaded profile CacheLoadedProfile(); UIControl.StartWindowUpdating(this.Handle); }
public IActionResult EditUserProfiles(DetailsUserProfilesModel model) { long uid = model.Userid; //验证权限 if (!authorizerHelper.IsUserPower(uid)) { return(Json(new StatusMessageData(StatusMessageType.Error, "选中的用户中有人的权限比您高!"))); } UserProfiles userProfiles = userProfilesService.GetUserProfiles(uid); userProfiles.Sex = model.Sex; userProfiles.Age = model.Age; userProfiles.Birthday = model.Birthday; userProfiles.SexualOrientation = model.SexualOrientation; userProfiles.IsSexualorientationSecrecy = model.IsSexualorientationSecrecy; userProfiles.Marriage = model.Marriage; userProfiles.IsMarriageSecrecy = model.IsMarriageSecrecy; userProfiles.Provinces = model.Provinces; userProfiles.City = model.City; userProfiles.IsNowareaSecrecy = model.IsNowareaSecrecy; bool result = userProfilesService.EditUserProfiles(userProfiles); if (result) { return(Json(new StatusMessageData(StatusMessageType.Success, "操作成功!"))); } return(Json(new StatusMessageData(StatusMessageType.Error, "操作失败!"))); }
public async Task DailyA() { DateTime now = DateTime.Now; var userPf = UserProfiles.GetAccount(Context.User); DateTime daily = userPf.daily; int difference = DateTime.Compare(daily, now); if ((userPf.daily.ToString() == "0001-01-01 00:00:00") || (daily.DayOfYear < now.DayOfYear && difference < 0 || difference >= 0)) { userPf.daily = DateTime.Now; userPf.Points += 200; UserProfiles.SaveProfiles(); await Context.Channel.SendMessageAsync($":white_check_mark: {Context.User.Username}, you claimed 200 Nico Nii's!"); } else { TimeSpan diff = now - daily; // This line compute the difference of time between the two dates // This line prevents "Your credits refresh in 00:18:57.0072170 !" TimeSpan di = new TimeSpan(23 - diff.Hours, 60 - diff.Minutes, 60 - diff.Seconds); string str = di.ToString(@"hh\:mm\:ss"); await ReplyAsync($":negative_squared_cross_mark: {Context.User.Username}, You have already claimed your daily Nico Nii's~\n\nThey refresh in {di.Days} day(s) {di.Hours} hour(s) {di.Minutes} min(s) and {di.Seconds} second(s)!"); } }
public async Task WhoIsUser(IGuildUser user) { var profile = UserProfiles.GetProfile(user as SocketUser); if (profile.bio == null) { await Context.Channel.SendMessageAsync(Vocabulary.GetText(Constants.RolePlayNoBio)); return; } var embed = new EmbedBuilder(); if (user.Nickname != null) { embed.WithTitle(Vocabulary.GetFormattedText(Constants.RolePlayProfileTitle, user.Nickname)); } else { embed.WithTitle(Vocabulary.GetFormattedText(Constants.RolePlayProfileTitle, user.Username)); } embed.WithThumbnailUrl(user.GetAvatarUrl()); embed.WithDescription(profile.bio); await Context.Channel.SendMessageAsync(null, false, embed.Build()); }
public ClientUser GetClientUser() { try { var lstProfiles = !string.IsNullOrEmpty(UserProfiles)? (UserProfiles.Split(',').Select(s => s.Trim())).ToList() : new List <string>(); var lstRoles = UserRoles.Split(',').Select(s => s.Trim()).ToList(); return(new ClientUser { Profiles = lstProfiles, Roles = lstRoles, //user must have some roles UserId = UserId, UserName = UserEmail, FullName = UserFullName, Culture = UserCulture, LanguageId = UserLanguageId, CompanyId = UserCompanyId, DepartmentId = UserDepartmentId }); } catch (Exception ex) { _logger.LogItem("GetUser - Could not compile user data" + ex.Message); } return(null); }
private void SetButtonStates(bool pblnEnableButtons) { this.btnDeleteProfile.Enabled = pblnEnableButtons; this.btnEditProfile.Enabled = pblnEnableButtons; // Also check this profile isn't currently either of the defaults if (lbProfiles.SelectedIndex > -1 && GlobalSettings.DefaultSpamProfileId.Equals(UserProfiles.GetProfileByName(GetSelectedProfileName()).Id) && GlobalSettings.DefaultHamProfileId.Equals(UserProfiles.GetProfileByName(GetSelectedProfileName()).Id)) { this.btnSetSpamDefault.Enabled = false; this.btnSetHamDefault.Enabled = false; } else if (lbProfiles.SelectedIndex > -1 && GlobalSettings.DefaultSpamProfileId.Equals(UserProfiles.GetProfileByName(GetSelectedProfileName()).Id)) { this.btnSetSpamDefault.Enabled = false; this.btnSetHamDefault.Enabled = pblnEnableButtons; } else if (lbProfiles.SelectedIndex > -1 && GlobalSettings.DefaultHamProfileId.Equals(UserProfiles.GetProfileByName(GetSelectedProfileName()).Id)) { this.btnSetHamDefault.Enabled = false; this.btnSetSpamDefault.Enabled = pblnEnableButtons; } else { this.btnSetSpamDefault.Enabled = pblnEnableButtons; this.btnSetHamDefault.Enabled = pblnEnableButtons; } }
public async Task Default(uint amount = 0) { var user = UserProfiles.GetAccount(Context.User); if (!user.IsRPS) { if (user.Points >= amount) { var embed = new EmbedBuilder() .WithColor(new Color(255, 73, 167)) .AddField("Let's play a game", "Choose between **rock**, **paper** or **scissors**.\n\n\"((≡|≡))_/ \_((≡|≡) )\""); await ReplyAsync("", false, embed.Build()); if (amount > 0) { user.IsRPSGamble = true; user.GambleAmount = amount; user.Points -= amount; } user.IsRPS = true; UserProfiles.SaveProfiles(); } else { await ReplyAsync($":negative_squared_cross_mark: {Context.User.Username}, you do not have enough Nico Nii's to play."); } } else { await ReplyAsync($":negative_squared_cross_mark: | {Context.User.Username}, you are already playing RPS!"); } }
public void Save(ReuseTech obj, IList matchList, UserProfiles up) { if (up != null) { HibernateTemplate.SaveOrUpdate(up); } if (obj != null) { HibernateTemplate.SaveOrUpdate(obj); } if (matchList != null) { foreach (Match item in matchList) { if (obj.Type.Equals("1")) { item.Rid1 = obj.Id; // ReuseTech ½s¸¹ } else { item.Rid2 = obj.Id; // ReuseTech ½s¸¹ } HibernateTemplate.Save(item); } } }
public bool UpdateUserDetails() { try { if (Action == Constants.InsertAction) { CreatedDate = UserContext.CurrentDate; UserCode = Guid.NewGuid(); } var objProfile = new UserProfile { UType = Constants.UserType, UCode = UserCode, Created = CreatedDate, LoginId = UserLoginId, Password = Password, Name = UserName, Address = Address, City = City, Country = Country, State = State, Zip = ZipCode, Mobile = Mobile, OffPhone = OfficePhone, ResPhone = ResidentialPhone, Email = Email, Dob = Dob, EmpId = EmployeeId, Gender = Gender, Designation = new Designation { Id = Designation }, ReportingTo = new Guid(ReportingTo), Branch = Branch, ActiveTill = ActiveTill, Wh = Warehouse, Dept = Department, Avatar = Avator, LastPasswordChanged = Dates.ToDateTime(LastPasswordChanged, DateFormat.Format_05), Bu = Bu, Off = Status, DefaultLink = Constants.DefaultHomeLink, Action = Action, DataBaseInfo = UserContext.DataBaseInfo }; var userProfiles = new UserProfiles { objProfile }; return(_controlPanel.ManageUsers(userProfiles)); } catch (Exception Ex) { AuditLog.LogEvent(SysEventType.ERROR, "Profile Creation", "Error occured while saving.", Ex); } return(false); }
private void Start() { canvas = GetComponentInChildren <Canvas>(); if (punSwitch != null) { punSwitchText = punSwitch.GetComponentInChildren <Text>(); punSwitch.onClick.AddListener(PunSwitchOnClick); } if (voiceSwitch != null) { voiceSwitchText = voiceSwitch.GetComponentInChildren <Text>(); voiceSwitch.onClick.AddListener(VoiceSwitchOnClick); } if (calibrateButton != null) { calibrateButton.onClick.AddListener(CalibrateButtonOnClick); calibrateText = calibrateButton.GetComponentInChildren <Text>(); } if (punState != null) { debugGO = punState.transform.parent.gameObject; } volumeBeforeMute = AudioListener.volume; previousDebugLevel = punVoiceNetwork.Client.LoadBalancingPeer.DebugOut; if (globalSettings != null) { globalSettings.SetActive(true); InitToggles(globalSettings.GetComponentsInChildren <Toggle>()); } if (devicesInfoText != null) { if (Microphone.devices == null || Microphone.devices.Length == 0) { devicesInfoText.enabled = true; devicesInfoText.color = Color.red; devicesInfoText.text = "No microphone device detected!"; } else if (Microphone.devices.Length == 1) { devicesInfoText.text = string.Format("Mic.: {0}", Microphone.devices[0]); } else { devicesInfoText.text = string.Format("Multi.Mic.Devices:\n0. {0} (active)\n", Microphone.devices[0]); for (int i = 1; i < Microphone.devices.Length; i++) { devicesInfoText.text = string.Concat(devicesInfoText.text, string.Format("{0}. {1}\n", i, Microphone.devices[i])); } } } #if !UNITY_EDITOR && UNITY_PS4 UserProfiles.LocalUsers localUsers = new UserProfiles.LocalUsers(); UserProfiles.GetLocalUsers(localUsers); int userID = localUsers.LocalUsersIds[0].UserId.Id; punVoiceNetwork.PS4UserID = userID; #endif }
private void ManageProfilesControl_ProfileListChanged(object sender) { // Clear the profile cache just in case UserProfiles.ClearProfileCache(); // Update the treeview LoadTreeView(); }
public bool UpdateUserDetails() { // Assign new action if action is empty or view if (Action == string.Empty || Action == Constants.ViewAction) { Action = Constants.InsertAction; } if (Action == Constants.InsertAction) { CreatedDate = UserContext.CurrentDate; UserCode = Guid.NewGuid(); } var objProfile = new UserProfile { UType = Constants.UserType, UCode = UserCode, Created = CreatedDate, LoginId = UserLoginId, Password = Password, Name = UserName, Address = Address, City = City, Country = Country, State = State, Zip = ZipCode, Mobile = Mobile, OffPhone = OfficePhone, ResPhone = ResidentialPhone, Email = Email, Dob = Dob, EmpId = EmployeeId, Gender = Gender, Designation = new Designation { Id = Designation }, ReportingTo = new Guid(ReportingTo), Branch = Branch, ActiveTill = ActiveTill, Wh = Warehouse, Dept = Department, Avatar = Avator, LastPasswordChanged = Dates.ToDateTime(LastPasswordChanged, DateFormat.Format_05), Bu = Bu, Off = Status, DefaultLink = Constants.DefaultHomeLink, Action = Action, DataBaseInfo = UserContext.DataBaseInfo }; var userProfiles = new UserProfiles { objProfile }; return(_controlPanel.ManageUsers(userProfiles)); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var username = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location).AppSettings.Settings["username"].Value; var password = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location).AppSettings.Settings["password"].Value; var context = new BildStudionDVContext(username, password); var deljobbDb = new DelJobb(context); var jobbDb = new Jobb(context, deljobbDb); var kundDb = new Kund(context, jobbDb); //kundjobbslogic var deljobbVm = new DelJobbVMLogic(deljobbDb); var jobbVM = new JobbVMLogic(jobbDb, deljobbVm); var kundVM = new KundVMLogic(kundDb, jobbVM); var inventarieDb = new Inventarie(context); var gruppDb = new Grupp(context, inventarieDb); var enhetDb = new Enhet(context, gruppDb); //inventarielogic var inventarieVM = new InventarieVMLogic(inventarieDb); var gruppVM = new GruppVMLogic(gruppDb, inventarieVM); var enhetVM = new EnhetVMLogic(enhetDb, gruppVM); //userlogic var usersDb = new UserProfiles(context); var userProfileVM = new UserProfileVMLogic(usersDb); var närvaroDb = new Närvaro(context); var deltagareDb = new Deltagare(context, närvaroDb); //närvarologic var deltagarVM = new DeltagareVMLogic(deltagareDb); var närvaroVM = new NärvaroVMLogic(närvaroDb, deltagareDb); DeltagarViewLogic deltagarViewLogic = new DeltagarViewLogic(deltagarVM, närvaroVM); MatlistaLogic matListaLogic = new MatlistaLogic(context, närvaroVM, deltagarVM); services.Add(new ServiceDescriptor(typeof(IDelJobbVMLogic), deljobbVm)); services.Add(new ServiceDescriptor(typeof(IJobbVMLogic), jobbVM)); services.Add(new ServiceDescriptor(typeof(IKundVMLogic), kundVM)); services.Add(new ServiceDescriptor(typeof(IInventarieVMLogic), inventarieVM)); services.Add(new ServiceDescriptor(typeof(IGruppVMLogic), gruppVM)); services.Add(new ServiceDescriptor(typeof(IEnhetVMLogic), enhetVM)); services.Add(new ServiceDescriptor(typeof(IUserProfileVMLogic), userProfileVM)); services.Add(new ServiceDescriptor(typeof(IDeltagareVMLogic), deltagarVM)); services.Add(new ServiceDescriptor(typeof(INärvaroVMLogic), närvaroVM)); services.Add(new ServiceDescriptor(typeof(IDeltagarViewLogic), deltagarViewLogic)); services.Add(new ServiceDescriptor(typeof(IMatlistaLogic), matListaLogic)); services.AddAuthentication("CookieAuthentication") .AddCookie("CookieAuthentication", config => { config.Cookie.Name = "UserLoginCookie"; config.LoginPath = "/Login/UserLogin"; }); services.AddControllersWithViews(); }
/// <summary> /// 使用指定的用户名查询用户信息实体对象。 /// </summary> /// <param name="username">要查询的用户名。</param> /// <returns>对应的用户信息实体对象。如果给定的用户名未在数据库中找到,返回 null。</returns> /// <exception cref="ArgumentNullException"/> public UserProfileEntity QueryUserProfileEntity(string username) { if (username == null) { throw new ArgumentNullException(nameof(username)); } return(UserProfiles.Find(username)); }
/// <summary> /// Sets the selected profile to be the default Ham reporting address /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSetHamDefault_Click(object sender, EventArgs e) { Profile theProfile = UserProfiles.GetProfileByName(GetSelectedProfileName()); // Set the global setting GlobalSettings.DefaultHamProfileId = theProfile.Id; // Reload the listbox PopulateList(); }
public UserProfiles GetAll() { UserProfiles users = new UserProfiles(); try { List<UserProfile> userList = _persist.SelectAll<UserProfile>(); foreach( UserProfile u in userList) { users.list.Add(u); } this._persist.InsertCache<UserProfiles>(users); } catch (Exception err) { throw new Exception(Errors.ERR_PROFILEM_PROFILES_NOT_FOUND, err); } return users; }