Esempio n. 1
0
    public static Profiles AddPassiveNetworkOption(Profiles profile, bool summary)
    {
        OutputFilterList ofl = new OutputFilterList();
        ofl.Default = OutputFilterDefaultEnum.all;

        ofl.OutputFilter = new List<OutputFilter>();
        OutputFilter of = new OutputFilter();

        // Keyword List
        of.Summary = summary;
        of.Text = "KeywordList";
        ofl.OutputFilter.Add(of);

        // SimilarPersonList
        of = new OutputFilter();
        of.Summary = summary;
        of.Text = "SimilarPersonList";
        ofl.OutputFilter.Add(of);

        // CoAuthorList
        of = new OutputFilter();
        of.Summary = summary;
        of.Text = "CoAuthorList";
        ofl.OutputFilter.Add(of);

        // NeighborList
        of = new OutputFilter();
        of.Summary = summary;
        of.Text = "NeighborList";
        ofl.OutputFilter.Add(of);

        profile.OutputOptions.OutputFilterList = ofl;

        return profile;
    }
Esempio n. 2
0
        public Profiles CreateProfile(string username, bool isAnonymous)
        {
            var p = new Profiles();
            var profileCreated = false;
            try
            {
                var usr = _userService.GetUserByUsernameApplicationName(username, ApplicationName);
                if (usr != null) //membership user exits so create a profile
                {
                    var profile = _profileService.GetProfileByUserId(usr.Id);
                    if (profile == null)
                    {
                        p.UserId = usr.Id;
                        p.IsAnonymous = isAnonymous;
                        p.LastUpdatedDate = DateTime.Now;
                        p.LastActivityDate = DateTime.Now;
                        p.ApplicationName = ApplicationName;
                        _profileService.Save(p);
                        profileCreated = true;
                    }
                    p = profile;
                }
                else
                    throw new ProviderException("Membership User does not exist.Profile cannot be created.");
            }
            catch (Exception e)
            {
                throw e;
            }

            if (profileCreated)
                return p;
            return null;
        }
        public Profiles GetProfileList()
        {
            Profiles profiles = new Profiles();
            using(AmazonSimpleDBClient client = new AmazonSimpleDBClient(_publicKey, _secretKey))
            {
                SelectRequest request = new SelectRequest { SelectExpression = "SELECT * FROM Profiles" };

                SelectResponse response = client.Select(request);

                var list = from item in response.SelectResult.Item
                           select new Profile()
                                      {
                                          Id = Guid.Parse(item.Attribute.GetValueByName("Id")), 
                                          Description = item.Attribute.GetValueByName("Description"),
                                          Location = item.Attribute.GetValueByName("Location"),
                                          Name = item.Attribute.GetValueByName("Name")
                                      };
                foreach (Profile profile in list)
                {
                    profiles.Add(profile);
                }
            }

            return profiles;
        }
        internal static string ProfileEntryPoint(Profiles val)
        {
            switch (val)
            {
                case Profiles.vs_5_0:
                    return "__vertex_shader";

                case Profiles.ps_5_0:
                    return "__pixel_shader";

                case Profiles.gs_5_0:
                    return "__geometry_shader";

                case Profiles.cs_5_0:
                    return "__compute_shader";
            }

            return "";
        }
        internal static string ProfileToString(Profiles val)
        {
            switch (val)
            {
                case Profiles.vs_5_0:
                    return "vs_5_0";

                case Profiles.ps_5_0:
                    return "ps_5_0";

                case Profiles.gs_5_0:
                    return "gs_5_0";

                case Profiles.cs_5_0:
                    return "cs_5_0";
            }

            return "";
        }
Esempio n. 6
0
    /// <summary>
    /// Initialize all of the internal objects inside of the query definition
    /// </summary>
    /// <returns>A new instance of type QueryDefinition</returns>
    public static Profiles GetNewProfilesDefinition()
    {
        QueryDefinition qd = new QueryDefinition();
        Profiles profiles = new Profiles();

        Name name = new Name();
        name.FirstName = new FirstName();
        name.LastName = new LastName();
        qd.Name = name;

        OutputOptions oo = new OutputOptions();
        oo.SortType = OutputOptionsSortType.QueryRelevance;
        oo.StartRecord = "0";

        Affiliation affiliation = new Affiliation();
        AffiliationList affList = new AffiliationList();

        //affiliations.AffiliationList = affList;
        affList.Affiliation = new List<Affiliation>();
        affList.Affiliation.Add(affiliation);

        FacultyRankList ftList = new FacultyRankList();
        ftList.FacultyRank = new List<string>();

        KeywordString kws = new KeywordString();
        Keywords kw = new Keywords();
        kw.KeywordString = new KeywordString();
        kw.KeywordString = kws;

        profiles.QueryDefinition = qd;
        profiles.QueryDefinition.AffiliationList = affList;
        profiles.QueryDefinition.Keywords = kw;
        profiles.QueryDefinition.Name = name;

        profiles.OutputOptions = oo;

        //its hard wired for 2 in this version.
        profiles.Version = 2;

        return profiles;
    }
        private void AddRow(Profiles.Edit.Utilities.FundingState fs, ref System.Text.StringBuilder sb)
        {
            string pi = string.Empty;
            string date = string.Empty;

            if(fs.PrincipalInvestigatorName!= string.Empty)
                pi = "(" + fs.PrincipalInvestigatorName + ")";

            if (fs.StartDate != "?")
                date = fs.StartDate;

            if (fs.EndDate != "?")
            {
                if (date != string.Empty)
                    date += "&nbsp;-&nbsp;" + fs.EndDate;
                else
                    date = fs.EndDate;
            }
            else if (fs.StartDate == "?" && fs.EndDate == "?")
                date = string.Empty;

            sb.Append("<tr><td>");
            if (fs.AgreementLabel != string.Empty)
                sb.Append(fs.AgreementLabel + "<br/>");
            if (fs.GrantAwardedBy != string.Empty)
                sb.Append("<span style='float:left'>" + fs.GrantAwardedBy + "</span> ");
            if (fs.FullFundingID != string.Empty)
                sb.Append("<span style='float:left'>" + fs.FullFundingID + "</span> ");
            if (date != string.Empty)
                sb.Append("<span style='float:right'>" + date + "</span>");
            if (fs.RoleDescription != string.Empty)
                sb.Append("<br/>Role Description: " + fs.RoleDescription);
            if (fs.RoleLabel != string.Empty)
                sb.Append("<br/>Role: " + fs.RoleLabel);

            sb.Append("</td></tr>");

            litHTML.Text = sb.ToString();
        }
Esempio n. 8
0
        public LaunchSettings(IWritableLaunchSettings settings, long version = 0)
        {
            Profiles = ImmutableList <ILaunchProfile> .Empty;
            foreach (IWritableLaunchProfile profile in settings.Profiles)
            {
                Profiles = Profiles.Add(new LaunchProfile(profile));
            }

            var jsonSerializerSettings = new JsonSerializerSettings()
            {
                NullValueHandling = NullValueHandling.Ignore
            };

            // For global settings we want to make new copies of each entry so that the snapshot remains immutable. If the object implements
            // ICloneable that is used, otherwise, it is serialized back to json, and a new object rehydrated from that
            GlobalSettings = ImmutableStringDictionary <object> .EmptyOrdinal;
            foreach ((string key, object value) in settings.GlobalSettings)
            {
                if (value is ICloneable cloneableObject)
                {
                    GlobalSettings = GlobalSettings.Add(key, cloneableObject.Clone());
                }
                else
                {
                    string jsonString   = JsonConvert.SerializeObject(value, Formatting.Indented, jsonSerializerSettings);
                    object?clonedObject = JsonConvert.DeserializeObject(jsonString, value.GetType());
                    if (clonedObject is not null)
                    {
                        GlobalSettings = GlobalSettings.Add(key, clonedObject);
                    }
                }
            }

            _activeProfileName = settings.ActiveProfile?.Name;
            Version            = version;
        }
Esempio n. 9
0
    public static Profiles AddPassiveNetworkOption(Profiles profile, bool summary)
    {
        OutputFilterList ofl = new OutputFilterList();

        ofl.Default = OutputFilterDefaultEnum.all;

        ofl.OutputFilter = new List <OutputFilter>();
        OutputFilter of = new OutputFilter();

        // Keyword List
        of.Summary = summary;
        of.Text    = "KeywordList";
        ofl.OutputFilter.Add(of);

        // SimilarPersonList
        of         = new OutputFilter();
        of.Summary = summary;
        of.Text    = "SimilarPersonList";
        ofl.OutputFilter.Add(of);

        // CoAuthorList
        of         = new OutputFilter();
        of.Summary = summary;
        of.Text    = "CoAuthorList";
        ofl.OutputFilter.Add(of);

        // NeighborList
        of         = new OutputFilter();
        of.Summary = summary;
        of.Text    = "NeighborList";
        ofl.OutputFilter.Add(of);

        profile.OutputOptions.OutputFilterList = ofl;

        return(profile);
    }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["email"] == null)
                {
                    Response.Redirect("Login.aspx");
                }
                String   email = Session["email"].ToString();
                Profiles prof  = new Profiles();
                prof = prof.GetProfileById(email);
                var acctype = prof.Acc_type.ToString();

                if (acctype == "Admin")
                {
                    adminaccess = true;
                }
                else
                {
                    adminaccess = false;
                }
                RefreshGridView();
            }
        }
        public UserControl LoadControl(string UserControlPath,  Profiles.Framework.Template masterpage, params object[] constructorParameters)
        {
            List<Type> constParamTypes = new List<Type>();
            //UserControl ctl = masterpage.LoadControl(UserControlPath) as UserControl;
            UserControl ctl = masterpage.LoadControl(UserControlPath) as UserControl;

            foreach (object constParam in constructorParameters)
            {
                constParamTypes.Add(constParam.GetType());
            }

            // Find the relevant constructor
            ConstructorInfo constructor = ctl.GetType().BaseType.GetConstructor(constParamTypes.ToArray());

            //And then call the standard constructor
            if (constructor == null)
                throw new MemberAccessException("The requested constructor was not found on : " + ctl.GetType().BaseType.ToString());
            else
            {
                constructor.Invoke(ctl, constructorParameters);
            }

            return ctl;
        }
Esempio n. 12
0
        /// <summary>
        /// The Handler method is executed by Hypar.
        /// </summary>
        /// <param name="input">A dictionary containing input data.
        /// This dictionary will be deserialized by the platform.</param>
        /// <param name="context">A context object used by Lambda.
        /// DO NOT use this, it will most likely go away in the future.</param>
        /// <returns>A dictionary containing results.</returns>
        public Dictionary <string, object> Handler(Dictionary <string, object> input, ILambdaContext context)
        {
            var length = double.Parse(input["length"].ToString());  // Find the length and convert to a number.
            var width  = double.Parse(input["width"].ToString());   // Find the width and convert to a number.
            var height = double.Parse(input["height"].ToString());  // Find the height and convert to a number.

            var profile = Profiles.Rectangular(Hypar.Geometry.Vector3.Origin(), width, height);

            var mass = Mass.WithBottomProfile(profile)
                       .WithTopProfile(profile)
                       .WithBottomAtElevation(0)
                       .WithTopAtElevation(length);

            // Add your mass element to a new Model.
            var model = new Model();

            model.AddElement(mass);

            // Add an extractor to count the masses.
            model.AddDataExtractor("number_of_masses", new MassCounter());

            // Use the ToHypar convenience method to serialize your Model.
            return(model.ToHypar());
        }
    private void BindGrdCoAuthors()
    {
        Profiles searchReq = ProfileHelper.GetNewProfilesDefinition();

        searchReq.QueryDefinition.PersonID = System.Convert.ToString(ProfileId);

        //searchReq.OutputOptions.OutputFilterList = new OutputFilterList();

        OutputFilterList    reqOutputFilterList = new OutputFilterList();
        List <OutputFilter> reqFilterList       = new List <OutputFilter>(1);

        OutputFilter reqFilter = new OutputFilter()
        {
            Summary = false, Text = "CoAuthorList"
        };

        reqFilterList.Add(reqFilter);
        reqOutputFilterList.OutputFilter = reqFilterList;

        searchReq.OutputOptions.OutputFilterList = reqOutputFilterList;

        grdAuthors.DataSource = new Connects.Profiles.Service.ServiceImplementation.ProfileService().ProfileSearch(searchReq).Person[0].PassiveNetworks.CoAuthorList.CoAuthor;
        grdAuthors.DataBind();
    }
Esempio n. 14
0
        public RunViewModel()
        {
            eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>();

            profiles = new ObservableCollection <ProfileObject>(NoteService.CurrentNotesAppSettings.Profiles);
            stages   = new ObservableCollection <StageObject>();

            var canRun = this.WhenAny(x => x.RunMode, x => x.SelectedNoteObject, x => x.SelectedProfile,
                                      (x1, x2, x3) => (x1.Value == RunMode.AllNotes) ||
                                      (x1.Value == RunMode.ByNote && x2.Value != null && x2.Value is NoteObject) ||
                                      (x1.Value == RunMode.ByProfile && x3.Value != null));

            RunCommand = ReactiveCommand.Create(Run, canRun);

            ReloadStages();

            RunMode = RunMode.AllNotes;

            refreshProfilesSubscriptionToken = eventAggregator.GetEvent <RefreshSettingsEvent>().Subscribe(x =>
            {
                Profiles.Clear();
                Profiles.AddRange(NoteService.CurrentNotesAppSettings.Profiles);
            });
        }
Esempio n. 15
0
        protected SocketError AcceptNeighbour(IAsyncResult ar)
        {
            if (this.Socket == null)
            {
                return(SocketError.NotSocket);
            }

            Socket socket = this.Socket.EndAccept(ar);

            using (Profiles profile = Profiles.FromFile("Profiles.xml"))
            {
                IPEndPoint ep = (IPEndPoint)socket.RemoteEndPoint;
                if (profile.Blacklist == null || !profile.Blacklist.IsDenied(ep.Address))
                {
                    this.Clients.Add(new HttpClient(ref socket));
                }
                else
                {
                    socket.Close();
                }
            }

            return(AcceptNeighbour());
        }
Esempio n. 16
0
        public ReturnResult <Profiles> GetProfileByID(int profileID)
        {
            var        result     = new ReturnResult <Profiles>();
            Profiles   profiles   = new Profiles();
            DbProvider dbProvider = new DbProvider();
            string     outCode    = String.Empty;
            string     outMessage = String.Empty;

            try
            {
                dbProvider.SetQuery("PROFILE_GET_BY_ID", CommandType.StoredProcedure)
                .SetParameter("ProfileId", SqlDbType.Int, profileID, ParameterDirection.Input)
                .SetParameter("ErrorCode", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
                .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 255, ParameterDirection.Output)
                .GetSingle <Profiles>(out profiles)
                .Complete();
                dbProvider.GetOutValue("ErrorCode", out outCode)
                .GetOutValue("ErrorMessage", out outMessage);

                if (outCode.ToString() != "0")
                {
                    result.Failed(outCode, outMessage);
                }
                else
                {
                    result.Item         = profiles;
                    result.ErrorCode    = "0";
                    result.ErrorMessage = "";
                }
            }
            catch (Exception ex)
            {
                result.Failed("-1", ex.Message);
            }
            return(result);
        }
        private void DeleteProfile([NotNull] object obj)
        {
            Assert.ArgumentNotNull(obj, "obj");

            var profileView = obj as ProfileViewModel;

            if (profileView == null)
            {
                return;
            }

            if (profileView.NameProfile == "Default")
            {
                return;
            }

            if (Profiles.Contains(profileView))
            {
                Profiles.Remove(profileView);
                SettingsHolder.Instance.DeleteProfile(profileView.NameProfile);
            }

            UpdateAddProfileCommandCanExecute();
        }
Esempio n. 18
0
        public MainViewModel()
        {
            SelectedProfile = new ProfileModel();
            //pulls models from external source but no logic which collections are for
            try
            {
                profileCommand = new ProfileCommand(_connectionString);
                //list that comes from the database will be added to Emplyees Bindable collection
                Profiles.AddRange(profileCommand.GetList());

                EmployeeCommand employeeCommand = new EmployeeCommand(_connectionString);
                //list that comes from the database will be added to Emplyees Bindable collection
                Employees.AddRange(employeeCommand.GetList());

                CompanyCommand companyCommand = new CompanyCommand(_connectionString);
                //list that comes from the database will be added to Emplyees Bindable collection
                Companies.AddRange(companyCommand.GetList());
            }
            catch (Exception ex)
            {
                AppStatus = ex.Message;
                NotifyOfPropertyChange(() => AppStatus);
            }
        }
Esempio n. 19
0
        private void Profiles_MouseDown(object sender, MouseEventArgs e)
        {
            var item = Profiles.HitTest(e.Location).Item;

            addProfileToolStripMenuItem.Visible = item == null;
            propertiesToolStripMenuItem.Visible =
                sep1.Visible                               =
                    sep2.Visible                           =
                        launchItem.Visible                 =
                            openLauncher.Visible           =
                                duplicateMenuItem.Visible  =
                                    renameMenuItem.Visible =
                                        propertiesToolStripMenuItem.Visible =
                                            openFolderItem.Visible          =
                                                desktopShortcutItem.Visible =
                                                    deleteItem.Visible      = item != null;
            if (item == null)
            {
                return;
            }
            renameMenuItem.Enabled = deleteItem.Enabled = item != DefaultProfileItem;
            propertiesToolStripMenuItem.Enabled = deleteItem.Enabled || (Control.ModifierKeys & Keys.Control) != 0;
            openLauncher.Enabled = GameUtils.BaseGame != null;
        }
        protected uint AddProfile(uint index, SpeechVerifier.Profile profile)
        {
            if (!profile.MinimumSecondsOfSpeech.HasValue)
            {
                profile.MinimumSecondsOfSpeech = 0;
            }
            SpeechRequired = profile.MinimumSecondsOfSpeech.Value;

            Profiles.Add(index, profile);

            if (Codec == WaveFormatEncoding.Unknown)
            {
                Codec = profile.Codec;
            }

            Logger?.LogDebug("SpeechVerifierBase.AddProfile(): Type: {0}", profile.Type);
            Logger?.LogDebug("SpeechVerifierBase.AddProfile(): Codec: {0}", profile.Codec);
            Logger?.LogDebug("SpeechVerifierBase.AddProfile(): MinimumSecondsOfSpeech: {0}", profile.MinimumSecondsOfSpeech);
            Logger?.LogDebug("SpeechVerifierBase.AddProfile(): Pass Threshold: {0}", profile.PassThreshold);
            Logger?.LogDebug("SpeechVerifierBase.AddProfile(): Fail Threshold: {0}", profile.FailThreshold);
            Logger?.LogDebug("SpeechVerifierBase.AddProfile(): Index: {0}", index);

            return(index);
        }
        public override void LoadProfiles()
        {
            string profiles_path = GetProfileFolderPath();

            if (Directory.Exists(profiles_path))
            {
                foreach (string profile in Directory.EnumerateFiles(profiles_path, "*.json", SearchOption.TopDirectoryOnly))
                {
                    string          profile_name     = Path.GetFileNameWithoutExtension(profile);
                    ProfileSettings profile_settings = LoadProfile(profile);

                    if (profile_settings != null)
                    {
                        if (profile_name.Equals("default"))
                        {
                            Settings = profile_settings;
                        }
                        else if (profile_name.Equals("app_info"))
                        {
                            continue;
                        }
                        else
                        {
                            if (!Profiles.ContainsKey(profile_name))
                            {
                                Profiles.Add(profile_name, profile_settings);
                            }
                        }
                    }
                }
            }
            else
            {
                Global.logger.LogLine(string.Format("Profiles directory for {0} does not exist.", Name), Logging_Level.Info, false);
            }
        }
Esempio n. 22
0
        public async Task <bool> MoveDownProfileAsync()
        {
            Debug.WriteLine("MoveDown start!");

            var targetProfile = Profiles.FirstOrDefault(x => x.IsTarget);

            if (targetProfile == null)
            {
                return(false);
            }

            var oldPosition = targetProfile.Position;
            var newPosition = oldPosition + 1;

            if (newPosition > targetProfile.PositionCount - 1)
            {
                return(false);
            }

            return(await WorkAsync(
                       x => _worker.SetProfilePositionAsync(x, newPosition),
                       x => Profiles.Contains(x) && (x.Position > oldPosition),
                       targetProfile));
        }
Esempio n. 23
0
        private void DeleteProfileCallback(JObject request, JObject response)
        {
            var     code = response["returnCode"].ToObject <UInt64>();
            Profile save = null;

            if (code == 0)
            {
                foreach (var profile in Profiles)
                {
                    if (profile.Id == request["id"].ToObject <UInt64>())
                    {
                        save = profile;
                    }
                }
                if (save != null)
                {
                    Profiles.Remove(save);
                }
            }
            else
            {
                HandleError(response);
            }
        }
 public void AddProfile(Profile profile)
 {
     profile.Id = Id++;
     Profiles.Add(profile);
 }
 public Profile GetProfile(int id) =>
 Profiles.FirstOrDefault(p => p.Id == id);
 public void DeleteSelectedProfile()
 {
     Profiles.Remove(SelectedProfile);
 }
Esempio n. 27
0
 private static void CMSave()
 {
     Transactions.Export();
     Profiles.Export();
 }
Esempio n. 28
0
        private ProfileInfo GetProfileInfoFromProfile(Profiles p)
        {
            Users usr = null;
            using (ISession session = SessionFactory.OpenSession())
            {
                usr = session.CreateCriteria(typeof(Users))
                                        .Add(NHibernate.Criterion.Restrictions.Eq("Id", p.Users_Id))
                                        .Add(NHibernate.Criterion.Restrictions.Eq("ApplicationName", ApplicationName))
                                        .UniqueResult<Users>();
            }
            if (usr == null)
                throw new ProviderException("The userid not found in memebership tables.GetProfileInfoFromProfile(p)");

            // ProfileInfo.Size not currently implemented.
            ProfileInfo pi = new ProfileInfo(usr.Username,
                p.IsAnonymous, p.LastActivityDate, p.LastUpdatedDate, 0);

            return pi;
        }
 public void AddToProfiles(Profiles profiles)
 {
     base.AddObject("Profiles", profiles);
 }
Esempio n. 30
0
        private ProfileInfo GetProfileInfoFromProfile(Profiles p)
        {
            Users usr = null;
            usr = _userService.GetUserByIdApplicationName(p.UserId, ApplicationName);
            if (usr == null)
                throw new ProviderException("The userid not found in memebership tables.GetProfileInfoFromProfile(p)");

            // ProfileInfo.Size not currently implemented.
            var pi = new ProfileInfo(usr.Username,
                p.IsAnonymous, p.LastActivityDate, p.LastUpdatedDate, 0);

            return pi;
        }
Esempio n. 31
0
        // Make like mojang launcher
        public void launprof(string name, string version, string client, string mdir)
        {
            Authentication auth = new Authentication();
            auth.username = name;

            Profiles pr = new Profiles();
            pr.authentication = auth;
            pr.javaArgs = "";
            pr.lastVersionId = client;
            pr.name = client;

            Dictionary<string, Profiles> pro = new Dictionary<string, Profiles>();
            pro.Add(client, pr);

            LaunchProfiles prof = new LaunchProfiles();
            prof.clientToken = "";
            prof.selectedProfile = client;
            prof.profiles = pro;

            try
            {
                string output = JsonConvert.SerializeObject(prof, Formatting.Indented);

                bool fexist = File.Exists(mdir + "\\launcher_profiles.json");
                if (fexist == true)
                    File.Delete(mdir + "\\launcher_profiles.json");

                StreamWriter sr = new StreamWriter(mdir + "\\launcher_profiles.json");
                sr.WriteLine(output);
                sr.Close();
            }
            catch
            {
                if (debug == true)
                    MessageBox.Show("Can't create launcher_profile.json");
            }
        }
Esempio n. 32
0
        public void loadNewProfileIntoStagingTables(Profiles.Proxy.Modules.AddProfile.Profile profile)
        {
            // Create a row in [Profile.Import].[Person]
            try
            {
                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType = CommandType.StoredProcedure;

                dbcommand.CommandText = "[Profile.Import].[InsertPersonData]";
                dbcommand.CommandTimeout = base.GetCommandTimeout();

                dbcommand.Parameters.Add(new SqlParameter("@FirstName", profile.firstName));
                dbcommand.Parameters.Add(new SqlParameter("@MiddleName", profile.middleName));
                dbcommand.Parameters.Add(new SqlParameter("@LastName", profile.lastName));
                dbcommand.Parameters.Add(new SqlParameter("@Gender", profile.gender));
                dbcommand.Parameters.Add(new SqlParameter("@AddressLineOne", profile.addressLineOne));
                dbcommand.Parameters.Add(new SqlParameter("@AddressLineTwo", profile.addressLineTwo));
                dbcommand.Parameters.Add(new SqlParameter("@City", profile.city));
                dbcommand.Parameters.Add(new SqlParameter("@State", profile.state));
                dbcommand.Parameters.Add(new SqlParameter("@Zip", profile.zip));
                dbcommand.Parameters.Add(new SqlParameter("@PhoneNumber", profile.phoneNumber));
                dbcommand.Parameters.Add(new SqlParameter("@Email", profile.emailAddress));

                dbcommand.Connection = dbconnection;
                dbcommand.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }

            // Create a row in [Profile.Import].[PersonAffiliation]
            try
            {
                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
                SqlConnection dbconnection = new SqlConnection(connstr);

                dbconnection.Open();

                SqlCommand dbcommand = new SqlCommand();
                dbcommand.CommandType = CommandType.StoredProcedure;

                dbcommand.CommandText = "[Profile.Import].[InsertPersonAffiliationData]";
                dbcommand.CommandTimeout = base.GetCommandTimeout();

                dbcommand.Parameters.Add(new SqlParameter("@Email", profile.emailAddress));
                dbcommand.Parameters.Add(new SqlParameter("@Title", profile.title));
                dbcommand.Parameters.Add(new SqlParameter("@InstitutionName", profile.institutionName));
                dbcommand.Parameters.Add(new SqlParameter("@InstitutionAbbreviation", profile.institutionAbbreviation));
                dbcommand.Parameters.Add(new SqlParameter("@DepartmentName", profile.departmentName));

                dbcommand.Connection = dbconnection;
                dbcommand.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Esempio n. 33
0
        public Author(dynamic dto)
        {
            profiles = new Profiles();

            Init(dto);
        }
Esempio n. 34
0
 public void Delete(Profiles entity)
 {
     _profileRepository.Delete(entity);
 }
Esempio n. 35
0
        public UnconventionalAuthor(dynamic dto)
        {
            profiles = new Profiles();

            Init(dto);
        }
Esempio n. 36
0
    private void InitalizePage()
    {
        string profileId = Convert.ToString(Request.QueryString["Person"]);

        // Get a copy of the last search
        Profiles personQuery = new Profiles();
        personQuery.QueryDefinition = new QueryDefinition();
        personQuery.OutputOptions = new OutputOptions();
        personQuery.OutputOptions.StartRecord = "0";

        personQuery.QueryDefinition.Keywords = ((Profiles)Session["ProfileSearchRequest"]).QueryDefinition.Keywords;

        // Set the selection input parameter to the session variable holding the search request
        personQuery.QueryDefinition.PersonID = profileId;

        PublicationMatchDetailList pmdl = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetProfilePublicationMatchSummary(personQuery);

        personQuery.Version = 2;
        PersonList thisPerson = new Connects.Profiles.Service.ServiceImplementation.ProfileService().ProfileSearch(personQuery);
        lstViewHeader.DataSource = thisPerson.Person;
        lstViewHeader.DataBind();

        rptMatchingPubs.DataSource = thisPerson.Person[0].PublicationList;
        rptMatchingPubs.DataBind();

        lblSubTitle.Text = String.Format("Search Results to {0} {1}", thisPerson.Person[0].Name.FirstName, thisPerson.Person[0].Name.LastName);
        lblSubTitleCaptionText.Text = String.Format("This is a \"connection\" page, showing why {0} {1} matched the keywords from your search.", thisPerson.Person[0].Name.FirstName, thisPerson.Person[0].Name.LastName);
    }
        private Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person GetPageControlValues(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person bo)
        {
            bo.AlternateEmails = new List<Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonAlternateEmail>();

            //bo.InternalUsername = LoggedInInternalUsername;
            bo.PersonStatusTypeID = (int)Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.ORCID_Created;

            if (!this.txtFirstName.Text.Equals(string.Empty))
            {
                bo.FirstName = this.txtFirstName.Text;
            }
            else
            {
                bo.FirstNameIsNull = true;
            }
            if (!this.txtLastName.Text.Equals(string.Empty))
            {
                bo.LastName = this.txtLastName.Text;
            }
            else
            {
                bo.LastNameIsNull = true;
            }
            if (!this.txtPublishedName.Text.Equals(string.Empty))
            {
                bo.PublishedName = this.txtPublishedName.Text;
            }
            foreach (string othername in this.txtOtherNames.Text.Split(Environment.NewLine.ToCharArray()))
            {
                if (!othername.Trim().Equals(string.Empty))
                {
                    Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonOthername otherNameBO = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonOthername();
                    otherNameBO.OtherName = othername.Trim();
                    bo.Othernames.Add(otherNameBO);
                }
            }
            if (!this.txtEmailAddress.Text.Equals(string.Empty))
            {
                bo.EmailAddress = this.txtEmailAddress.Text;
            }
            else
            {
                bo.EmailAddressIsNull = true;
            }
            if (!this.ddlEmailDecisionID.Text.Equals(string.Empty))
            {
                bo.EmailDecisionID = int.Parse(this.ddlEmailDecisionID.SelectedValue);
            }
            else
            {
                bo.EmailDecisionIDIsNull = true;
            }
            if (!this.ddlAlternateEmailDecisionID.Text.Equals(string.Empty))
            {
                bo.AlternateEmailDecisionID = int.Parse(this.ddlAlternateEmailDecisionID.SelectedValue);
            }
            else
            {
                bo.AlternateEmailDecisionIDIsNull = true;
            }
            foreach (string email in this.txtAlternateEmail.Text.Split(Environment.NewLine.ToCharArray()))
            {
                if (!email.Equals(string.Empty))
                {
                    Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonAlternateEmail emailBO = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonAlternateEmail();
                    emailBO.EmailAddress = email;
                    bo.AlternateEmails.Add(emailBO);
                }
            }
            return bo;
        }
 public static Profiles CreateProfiles(global::System.Guid profileId, string profileName, string patternValues)
 {
     Profiles profiles = new Profiles();
     profiles.ProfileId = profileId;
     profiles.ProfileName = profileName;
     profiles.PatternValues = patternValues;
     return profiles;
 }
 public static void AddProfile(PortScannerProfileInfo profile)
 {
     Profiles.Add(profile);
 }
 private void GetErrorsAndMessages(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person bo)
 {
     AddError(bo.Error);
     this.lblFirstNameErrors.Text = bo.FirstNameErrors;
     this.lblLastNameErrors.Text = bo.LastNameErrors;
     this.lblPublishedNameErrors.Text = bo.PublishedNameErrors;
     this.lblEmailAddressErrors.Text = bo.EmailAddressErrors;
     this.lblAlternateEmailDecisionIDErrors.Text = bo.AlternateEmailDecisionIDErrors;
     this.UploadInfoToORCID1.ResearchExpertiseAndProfessionalInterestsErrors = bo.BiographyErrors;
 }
Esempio n. 41
0
        private Profiles CreateProfile(string username, bool isAnonymous)
        {
            Profiles p = new Profiles();
            bool profileCreated = false;

            using (ISession session = SessionFactory.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    try
                    {
                        Users usr = session.CreateCriteria(typeof(Users))
                                                    .Add(NHibernate.Criterion.Restrictions.Eq("Username", username))
                                                    .Add(NHibernate.Criterion.Restrictions.Eq("ApplicationName", ApplicationName))
                                                    .UniqueResult<Users>();

                        if (usr != null) //membership user exits so create a profile
                        {
                            p.Users_Id= usr.Id;
                            p.IsAnonymous = isAnonymous;
                            p.LastUpdatedDate = System.DateTime.Now;
                            p.LastActivityDate = System.DateTime.Now;
                            p.ApplicationName = ApplicationName;
                            p.BirthDate = DateTime.Now;
                            session.Save(p);
                            transaction.Commit();
                            profileCreated = true;
                        }
                        else
                            throw new ProviderException("Membership User does not exist.Profile cannot be created.");

                    }
                    catch (Exception e)
                    {
                        if (WriteExceptionsToEventLog)
                            WriteToEventLog(e, "GetProfile");
                        else
                            throw e;
                    }
                }

            }

            if (profileCreated)
                return p;
            else
                return null;
        }
Esempio n. 42
0
        public ConfigurationVM(MainVM mvm)
        {
            MainVM          = mvm;
            ProfilesDisplay = Profiles.Connect().ToObservableCollection(this);
            PatchersDisplay = this.WhenAnyValue(x => x.SelectedProfile)
                              .Select(p => p?.Patchers.Connect() ?? Observable.Empty <IChangeSet <PatcherVM> >())
                              .Switch()
                              .ToObservableCollection(this);

            CompleteConfiguration = ReactiveCommand.CreateFromTask(
                async() =>
            {
                var initializer = this.NewPatcher;
                if (initializer == null)
                {
                    return;
                }
                AddNewPatchers(await initializer.Construct().ToListAsync());
            },
                canExecute: this.WhenAnyValue(x => x.NewPatcher)
                .Select(patcher =>
            {
                if (patcher == null)
                {
                    return(Observable.Return(false));
                }
                return(patcher.WhenAnyValue(x => x.CanCompleteConfiguration)
                       .Select(e => e.Succeeded));
            })
                .Switch());

            CancelConfiguration = ReactiveCommand.Create(
                () =>
            {
                NewPatcher?.Cancel();
                NewPatcher = null;
            });

            // Dispose any old patcher initializations
            this.WhenAnyValue(x => x.NewPatcher)
            .DisposePrevious()
            .Subscribe()
            .DisposeWith(this);

            _DisplayedObject = Observable.CombineLatest(
                this.WhenAnyValue(x => x.SelectedProfile !.DisplayedObject),
                this.WhenAnyValue(x => x.NewPatcher),
                (selected, newConfig) => (newConfig as object) ?? selected)
                               .ToGuiProperty(this, nameof(DisplayedObject), default);

            RunPatchers = NoggogCommand.CreateFromJob(
                extraInput: this.WhenAnyValue(x => x.SelectedProfile),
                jobCreator: (profile) =>
            {
                if (SelectedProfile == null)
                {
                    return(default(PatchersRunVM?), Observable.Return(Unit.Default));
                }
                var ret            = new PatchersRunVM(this, SelectedProfile);
                var completeSignal = ret.WhenAnyValue(x => x.Running)
                                     .TurnedOff()
                                     .FirstAsync();
                return(ret, completeSignal);
            },
                createdJobs: out var createdRuns,
                canExecute: this.WhenAnyFallback(x => x.SelectedProfile !.BlockingError, fallback: ErrorResponse.Failure)
                .Select(err => err.Succeeded))
                          .DisposeWith(this);

            _CurrentRun = createdRuns
                          .ToGuiProperty(this, nameof(CurrentRun), default);

            this.WhenAnyValue(x => x.CurrentRun)
            .NotNull()
            .Do(run => MainVM.ActivePanel = run)
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(r => r.Run())
            .DisposeWith(this);

            ShowHelpToggleCommand = ReactiveCommand.Create(() => ShowHelp = !ShowHelp);
        }
 private void LoadPageLabels(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person)
 {
     //lblOrganizationName.Text = ProfilesRNSDLL.DevelopmentBase.Common.GetConfig("ORCID.OrganizationName").ToString();
 }
 public static void RemoveProfile(PortScannerProfileInfo profile)
 {
     Profiles.Remove(profile);
 }
 private bool AssociateORCIDWithOrganizationID(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person, string orcid)
 {
     person.ORCID = orcid;
     person.PersonStatusTypeID = (int)Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.ORCID_Provided;
     person.ORCIDRecorded = DateTime.Now;
     return PersonBLL.Save(person);
 }
Esempio n. 46
0
 private static void CMLoad()
 {
     Transactions.Import();
     Profiles.Import();
 }
 public ConversionProfile GetProfileByName(string name)
 {
     return(Profiles.FirstOrDefault(p => p.Name == name));
 }
        public async Task <JsonResult> OnPost([FromBody] Persons registroGuardar)
        {
            Participant   = User.Claims.Where(x => x.Type == "Participant").Select(x => x.Value).SingleOrDefault();
            Owner         = User.Claims.Where(x => x.Type == "Owner").Select(x => x.Value).SingleOrDefault();
            Country       = User.Claims.Where(x => x.Type == "Country").Select(x => x.Value).SingleOrDefault();
            Confirmant    = User.Claims.Where(x => x.Type == "Confirmant").Select(x => x.Value).SingleOrDefault();
            Discriminator = User.Claims.Where(x => x.Type == "Discriminator").Select(x => x.Value).SingleOrDefault();
            var    Auth  = (await _AuthorizationService.AuthorizeAsync(User, "PolicyProfileChange")).Succeeded;
            string Err   = null;
            var    token = HttpContext.Session.GetString("token");

            registrarClienteTF.User               = new User();
            registrarClienteTF.Registrarse        = new PesonProfile();
            registrarClienteTF.User.Participant   = Participant;
            registrarClienteTF.User.Discriminator = Discriminator;

            Profiles PerfilUser = new Profiles();

            registroGuardar.Address.Country = int.Parse(Country);
            registroGuardar.Address.Label   = "LEGAL";
            if (registroGuardar.Phone != null)
            {
                registroGuardar.Phone.Country = int.Parse(Country);
            }

            PerfilUser.Id      = Owner;
            PerfilUser.Country = int.Parse(Country);
            //PerfilUser.Company = registroGuardar.Company;
            PerfilUser.Addresses.Add(registroGuardar.Address);
            if (registroGuardar.Contacts != null)
            {
                foreach (var Contacto in registroGuardar.Contacts)
                {
                    if (Contacto.Label != "LEGAL")
                    {
                        PerfilUser.Contacts.Add(Contacto);
                    }
                    else
                    {
                        Contact Representante = JsonConvert.DeserializeObject <Contact>(HttpContext.Session.GetString("RepresentanteLegal"));
                        Representante.PhoneNumber = Contacto.PhoneNumber;
                        if (Representante != null && Representante.Id != null && Representante.Id != "")
                        {
                            PerfilUser.Contacts.Add(Representante);
                        }
                    }
                }
            }
            //PerfilUser.Contacts = registroGuardar.Contacts;
            PerfilUser.Discriminator = registroGuardar.Discriminator;
            //PerfilUser.Documents.Add(registroGuardar.Document);
            if (registroGuardar.Email != null)
            {
                PerfilUser.Emails.Add(registroGuardar.Email);
            }
            //PerfilUser.FirstName = registroGuardar.FirstName;
            //PerfilUser.LastName = registroGuardar.LastName;
            PerfilUser.Participant = registroGuardar.Participant;
            //PerfilUser.Phones.Add(registroGuardar.Phone);
            //PerfilUser.Category = registroGuardar.Category;
            if (registroGuardar.Accounts != null)
            {
                PerfilUser.Accounts = registroGuardar.Accounts;
            }
            registrarClienteTF.Perfil = await _peopleService.UpdateProfileTF(PerfilUser, token);

            if (registrarClienteTF.Perfil.Error == null)
            {
                var id = User.Claims.Where(x => x.Type == "Id").Select(x => x.Value).SingleOrDefault();
                var l  = await _aS.RefreshToken(id, CultureInfo.CurrentCulture.Name, Participant, token, Confirmant);

                if (l.Error == null)
                {
                    HttpContext.Session.SetString("token", l.Token);
                }
            }
            if (registrarClienteTF.Perfil.Error != null)
            {
                Err = registrarClienteTF.Perfil.Error;
                filterInvoice PeopleId = new filterInvoice();
                PeopleId.Id = Owner;
                registrarClienteTF.Perfil = await _peopleService.RegisterById(new ParamProspecto { Participant = Participant, Filter = PeopleId, Country = int.Parse(Country) }, token);
            }
            if (HttpContext.Session.GetString("CountryPerfil") == null || HttpContext.Session.GetString("CountryPerfil") == "null" || HttpContext.Session.GetString("CountryPerfil") == "")
            {
                registrarClienteTF.DataPaises = await _globalService.ConsultasCountryTF(new ParamCountry { Id = int.Parse(Country) });

                HttpContext.Session.SetString("CountryPerfil", JsonConvert.SerializeObject(registrarCliente.DataPaises));
            }
            else
            {
                registrarClienteTF.DataPaises = JsonConvert.DeserializeObject <ListCountry>(HttpContext.Session.GetString("CountryPerfil"));
            }
            if (registrarClienteTF.Perfil.Addresses != null)
            {
                registrarClienteTF.Cities = await _globalService.ConsultaCitiesTF(new ParamCountry { Id = int.Parse(Country), Region = registrarClienteTF.Perfil.Addresses[0].Region });
            }
            RellenarPerfil();

            registrarClienteTF.AuthRol     = Auth;
            registrarClienteTF.ContratAuth = (await _AuthorizationService.AuthorizeAsync(User, "PolicyContracts")).Succeeded;
            return(new JsonResult(new { error = Err, person = registrarClienteTF }));
        }
Esempio n. 49
0
 public static void RemoveProfile(ProfileInfo profile)
 {
     Profiles.Remove(profile);
 }
 public Profile GetProfile(string name) =>
 Profiles.FirstOrDefault(p => p.FirstName == name);
Esempio n. 51
0
        public ActionResult View(string id)
        {
            var invoice = new Invoice();
            invoice = _invoiceService.GetDataById(new Guid(id));

            var model = new BuyModel();
            var store = new StoreModel();
            var cashier = new Profiles();
            var appraiser = new Profiles();
            var customer = new Customer();
            cashier = _profileService.GetProfileByUserId(invoice.Cashier.Id);
            appraiser = _profileService.GetProfileByUserId(invoice.Appraiser.Id);
            customer = _customerService.GetDataById(invoice.Customer.Id);

            model.StoreId = invoice.Store.Id.ToString();
            model.StoreName = invoice.Store.Name;
            model.StoreAddress = invoice.Store.Address;
            model.StoreTelephoneNo = invoice.Store.TelephoneNo;

            model.InvoiceNo = invoice.InvoiceNo;
            model.Cashier = Base.GenerateFullName(cashier.FirstName, cashier.MiddleName, cashier.LastName);
            model.Appraiser = Base.GenerateFullName(appraiser.FirstName, appraiser.MiddleName, appraiser.LastName);
            model.Customer = Base.GenerateFullName(customer.FirstName, customer.MiddleName, customer.LastName);
            //summary
            model.SubTotal = invoice.SubTotal;
            model.TotalBonus = invoice.TotalBonus;
            model.GrandTotal = invoice.GrandTotal;
            //purchases
            model.Purchases = invoice.Purchases;
            //company
            model.CompanyName = ConfigManager.Exchange.CompanyName;

            TempData["Invoice"] = model;

            return View(model);
        }
 public void DeleteProfile(int id) =>
 Profiles.RemoveAll(p => p.Id == id);
Esempio n. 53
0
 public void SaveChanges(Profiles entity)
 {
     _profileRepository.SaveChanges(entity);
 }
Esempio n. 54
0
 public static void AddProfile(ProfileInfo profile)
 {
     Profiles.Add(profile);
 }
Esempio n. 55
0
 public void ResetProfile()
 {
     Profile = Profiles.Configure;
 }
Esempio n. 56
0
 public void RegisterProfile(Profiles profile)
 {
     _datacontext.Profiles.Add(profile);
     DBOperations.AddToDatabase(profile);
 }
Esempio n. 57
0
 public void SaveOrUpdate(Profiles entity)
 {
     _profileRepository.SaveOrUpdate(entity);
 }