/// <summary>
 /// Create a new UserSettings object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="namingConvention">Initial value of the NamingConvention property.</param>
 /// <param name="holidayColor">Initial value of the HolidayColor property.</param>
 /// <param name="timeSlotDuration">Initial value of the TimeSlotDuration property.</param>
 /// <param name="workHourColor">Initial value of the WorkHourColor property.</param>
 /// <param name="dayColor">Initial value of the DayColor property.</param>
 /// <param name="activeViewType">Initial value of the ActiveViewType property.</param>
 public static UserSettings CreateUserSettings(global::System.Int32 id, global::System.Byte namingConvention, global::System.Int32 holidayColor, global::System.Int32 timeSlotDuration, global::System.Int32 workHourColor, global::System.Int32 dayColor, global::System.Int32 activeViewType)
 {
     UserSettings userSettings = new UserSettings();
     userSettings.Id = id;
     userSettings.NamingConvention = namingConvention;
     userSettings.HolidayColor = holidayColor;
     userSettings.TimeSlotDuration = timeSlotDuration;
     userSettings.WorkHourColor = workHourColor;
     userSettings.DayColor = dayColor;
     userSettings.ActiveViewType = activeViewType;
     return userSettings;
 }
Beispiel #2
0
        public static void Insert(Employee item)
        {
            EntityModelContainer context = GetContext();

            if (item.EntityState != EntityState.Added)
            {
                context.AddObject(item.GetType().Name + "s", item);
            }
            if (item.UserSetting == null)
            {
                UserSettings userSetting = new UserSettings
                                               {
                                                   HolidayColor = (int) Constants.Color.Green,
                                                   WorkHourColor = (int) Constants.Color.White,
                                                   DayColor = (int) Constants.Color.NoColor,
                                                   TimeSlotDuration = 2,
                                                   ActiveViewType = 2,
                                                   NamingConvention = 0
                                               };
                item.UserSetting = userSetting;
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the UserSettings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUserSettings(UserSettings userSettings)
 {
     base.AddObject("UserSettings", userSettings);
 }