예제 #1
0
        public static string CreateNewProfile(bool disablePrivateProfile)
        {
            var profileList = GetProfileList(ProfileItemPrivacyType.Public.ToString());

loop:
            var it = new ProfileEditor();

            if (it.ShowDialog() != true)
            {
                return(null);
            }
            var profileName     = it.GetProfileName();
            var mainProcessName = it.GetMainProcessName();

            if (profileList.ContainsKey(profileName))
            {
                MessageBox.Show(LanguageManager.GetPhrase(Phrases.SettingsMessageProfileNameIsAlreadyExist),
                                LanguageManager.GetPhrase(Phrases.MessageBoxErrorHeader),
                                MessageBoxButton.OK, MessageBoxImage.Error);
                goto loop;
            }
            Clear();
            _currentProfileName         = profileName;
            _mainSimulatorProcess       = mainProcessName;
            _currentProfilePath         = GenerateProfileFileName();
            _currentPersonalProfilePath = _currentProfilePath.Replace(@"\" + ProfileFolder + @"\", @"\" + ProfileAssignmentsFolder + @"\") + "p";
            _currentProfileId           = GlobalId.GetNew();
            Save(disablePrivateProfile);
            return(profileName);
        }
예제 #2
0
        private void OnDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ProfileEditor profileEditor
                = new ProfileEditor(txtBlock.Text);

            profileEditor.ShowDialog();

            txtBlock.Text = profileEditor.ChangedName;
        }
예제 #3
0
        private void EditProfile_OnClick(object sender, RoutedEventArgs e)
        {
            ProfileEditor profileEditor = new ProfileEditor(user);

            profileEditor.ShowDialog();
            user = profileEditor.UpdatedUser;

            UsernameText.Text = user.Username;
            PasswordText.Text = user.Password;
            EmailText.Text    = user.EmailAddress;
        }
예제 #4
0
        public virtual void SaveSettings()
        {
            Settings?.Save();
            if (UsesProfileEditor)
            {
                ProfileEditor.SaveSelectedProfile();
            }
            if (!IsModuleActive)
            {
                return;
            }

            // Restart the module if it's currently running to apply settings.
            _moduleManager.ChangeActiveModule(ModuleModel);
        }
예제 #5
0
        private void btOpenProfile_Click(object sender, EventArgs e)
        {
            int curr = cbProfile.SelectedIndex;

            if (curr == -1)
            {
                return;
            }

            CurrProfile = profiles[curr];

            ProfileEditor pfEditor = new ProfileEditor();

            pfEditor.textBoxFileProfile.Text = CurrProfile.FileName;
            pfEditor.Show();
            pfEditor.LoadDataFromFile();
        }
예제 #6
0
    void OnGUI()
    {
        tab = GUILayout.Toolbar(tab, new string[] { "Profile", "Project" });

        scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, true, GUILayout.Width(Screen.width - 2), GUILayout.Height(Screen.height - 45 - 2));

        EditorGUILayout.Space();

        switch (tab)
        {
        case 0:
            ProfileEditor.Draw();
            break;

        case 1:
            ProjectSettingsEditor.Draw();
            break;
        }

        GUILayout.EndScrollView();
    }
예제 #7
0
    public void LightTab(ProfileEditor.Sections zSection)
    {
        if (zSection != ProfileEditor.Sections.Attributes)
        {
            SectionAttributes.color = Graycolor;
        }
        else
        {
            SectionAttributes.color = Color.white;
        }

        if (zSection != ProfileEditor.Sections.Modifiers)
        {
            SectionModifiers.color = Graycolor;
        }
        else
        {
            SectionModifiers.color = Color.white;
        }

        if (zSection != ProfileEditor.Sections.Powers)
        {
            SectionPowers.color = Graycolor;
        }
        else
        {
            SectionPowers.color = Color.white;
        }

        if (zSection != ProfileEditor.Sections.Notes)
        {
            SectionNotes.color = Graycolor;
        }
        else
        {
            SectionNotes.color = Color.white;
        }
    }
예제 #8
0
 public void Can_Edit_User_Profile()
 {
     LeftSideMenu.GoToProfile();
     ProfileEditor.EditAllProfileSettings();
     AssertThat.IsTrue(ProfileEditor.AreProfileChangesSavedCorrectly, "Profile changes did not save successfully after edit.");
 }
예제 #9
0
 protected override void OnDeactivate(bool close)
 {
     base.OnDeactivate(close);
     ProfileEditor.Deactivate();
 }
예제 #10
0
 protected override void OnActivate()
 {
     base.OnActivate();
     ProfileEditor.Activate();
 }
예제 #11
0
        public JsonResult EditStudentProfile(StudentprofileViewModel profileViewModel, ProfileEditor editOperation)
        {
            try
            {
                var token = _tokenValidator.Validate(HttpContext);
                if (!token.Success)
                {
                    return(Json(new ReturnData <string>
                    {
                        Success = false,
                        NotAuthenticated = true,
                        Message = $"Unauthorized:-{token.Message}",
                    }));
                }

                var settings       = _context.PortalConfigs.Any(c => c.Code == "008" && c.Status);
                var profileUpdates = new ProfileUpdates
                {
                    TelNo                = profileViewModel.Telno,
                    Email                = profileViewModel.Email,
                    HomeAddress          = profileViewModel.Homeaddress,
                    UserCode             = profileViewModel.AdmnNo,
                    DateCreated          = DateTime.Now,
                    AllowedAdminApproval = true,
                    Status               = false
                };

                if (settings)
                {
                    var updateProfileResults = _unisolApiProxy.EditStudentProfile(profileViewModel, classStatus, editOperation).Result;
                    var jdata = JsonConvert.DeserializeObject <ReturnData <string> >(updateProfileResults);
                    if (jdata.Success)
                    {
                        var portalUser = _context.Users.FirstOrDefault(u => u.UserName.ToUpper().Equals(profileViewModel.AdmnNo.ToUpper()));
                        if (portalUser != null)
                        {
                            portalUser.Email = profileViewModel.Email;
                            _context.SaveChanges();
                        }

                        return(Json(new ReturnData <string>
                        {
                            Success = true,
                            Message = "Profile Updated successfully"
                        }));
                    }
                }

                _context.ProfileUpdate.Add(profileUpdates);
                _context.SaveChanges();

                return(Json(new ReturnData <string>
                {
                    Success = false,
                    Message = "Profile Updated Request received, We shall contact yo shortly"
                }));
            }
            catch (Exception ex)
            {
                return(Json(new ReturnData <string>
                {
                    Success = false,
                    Message = "An error occured while trying to update the profile, please try again"
                }));
            }
        }
예제 #12
0
        public JsonResult UpadateStudentProfile(StudentprofileViewModel profileViewModel, string classStatus, ProfileEditor editOperation)
        {
            try
            {
                var register = _context.Register.FirstOrDefault(r => r.AdmnNo.ToUpper().Equals(profileViewModel.AdmnNo.ToUpper()));
                if (editOperation == ProfileEditor.EditContacts)
                {
                    register.Telno       = profileViewModel?.Telno;
                    register.Homeaddress = profileViewModel?.Homeaddress;
                    register.Email       = profileViewModel?.Email;
                }

                if (editOperation == ProfileEditor.EditOthers)
                {
                    register.Language = profileViewModel?.Language;
                    register.Special  = profileViewModel?.Medical;
                    register.Activity = profileViewModel?.Activity;
                }

                if (editOperation == ProfileEditor.EditEmergency)
                {
                    register.Emname    = profileViewModel?.EmergencyName;
                    register.Emrel     = profileViewModel?.EmergencyRelationShip;
                    register.Emtel     = profileViewModel?.EmergencyTelNo;
                    register.Ememail   = profileViewModel?.EmergencyEmail;
                    register.Emaddress = profileViewModel?.EmergencyAddress;
                    register.Emremarks = profileViewModel?.EmergencyRemarks;
                }

                if (editOperation == ProfileEditor.EditDependancies)
                {
                    var dependant = _context.StudDependant.FirstOrDefault(s => s.AdmnNo.ToUpper().Equals(profileViewModel.AdmnNo.ToUpper()));
                    dependant.Names        = profileViewModel?.DependantName;
                    dependant.Relationship = profileViewModel?.DependantRelationShip;
                    dependant.Gender       = profileViewModel?.DependantGender;
                    dependant.Tel          = profileViewModel?.DependantTelNo;
                    dependant.Occupation   = profileViewModel?.DependantOccupation;
                    dependant.Notes        = profileViewModel?.DependantNotes;
                }


                _context.SaveChanges();
                return(Json(new ReturnData <string>
                {
                    Success = true,
                    Message = "Profile Updated Successifully"
                }));
            }
            catch (Exception ex)
            {
                return(Json(new ReturnData <string>
                {
                    Success = false,
                    Message = "An error occurred,please retry : " + ex.Message
                }));
            }
        }
예제 #13
0
    override public void OnInspectorGUI()
    {
        LightingSettings.Profile profile = target as LightingSettings.Profile;

        ProfileEditor.DrawProfile(profile);
    }
예제 #14
0
        public Task <string> EditStudentProfile(StudentprofileViewModel profileViewModel, string classStatus, ProfileEditor editOperation)
        {
            var response = Post($"profile/upadateStudentProfile/?classStatus={classStatus}&editOperation={editOperation}", profileViewModel);

            return(response);
        }