예제 #1
0
 public object Insert(string key)
 {
     AppEntry entry = new AppEntry();
     entry.entry_key = key;
     Insert(0, entry);
     return entry;
 }
예제 #2
0
 public void AddEntry(IDictionary row)
 {
     AppEntry entry = new AppEntry();
     foreach (DictionaryEntry col in row)
     {
         string key = Convert.ToString(col.Key);
         string value = Convert.ToString(col.Value);
         entry.Add(key, value);
     }
     Add(entry);
 }
예제 #3
0
 public AppEntry(AppEntry row)
 {
     AddAll(row);
 }
예제 #4
0
 /// <summary>
 /// Add each source entry to our internal store. 
 /// </summary>
 /// <remarks><p>
 /// Entries with keys that match the property names will be exposed. 
 /// Other entries may be added, but can only be retrieved via Get.
 /// </p></remarks>
 /// <param name="row">Entries to add</param>
 /// 
 public void AddAll(AppEntry row)
 {
     ICollection keys = row.Keys;
     foreach (string key in keys)
     {
         Add(key, row.Get(key));
     }
 }
예제 #5
0
        /// <summary>
        /// Create or retrieve an AppUserProfile 
        /// based on the client's WindowsIdentity.
        /// </summary>
        /// <returns>A new or prexisting AppUserProfile</returns>
        /// 
        protected AppUserProfile NewProfile()
        {
            WindowsIdentity id = WindowsIdentity.GetCurrent();
            AppUserProfile profile = new AppUserProfile(id);
            Session[UserProfile.USER_PROFILE] = profile;

            IViewHelper helper = Catalog.GetHelperFor(App.ENTRY);
            helper.Criteria[App.USER_NAME] = profile.UserId;
            helper.Execute();
            if (helper.IsNominal)
            {
                string editor = helper.Criteria[App.EDITOR] as string;
                // ISSUE: Need constant for "1" (true)
                bool isEditor = ((editor != null) && (editor.Equals("1")));
                profile.IsEditor = isEditor;
                if (editor != null)
                {
                    AppEntry entry = new AppEntry();
                    entry.AddAll(helper.Criteria);
                    profile.Entry = entry;
                }
            }
            return profile;
        }