private void ImportTable(String connectionString, Int32 offsetHour)
        {
            var l = new List <DatabaseObject>();
            DatabaseSchemaReader db = DatabaseSchemaReader.Create(AValue.SchemaData.DatabaseServer, connectionString);

            foreach (var item in db.GetTables())
            {
                if (this.ImportAllCheckBox.IsChecked == false &&
                    item.LastAlteredTime + TimeSpan.FromHours(offsetHour) < AValue.SchemaData.LastExecuteTimeOfImportTable)
                {
                    continue;
                }
                if (AValue.SchemaData.IgnoreObjects.Exists(el => el.Name == item.Name) == true)
                {
                    continue;
                }

                l.Add(item);
            }

            _Tables.Clear();
            foreach (var item in l.Select(el => CheckedItem.Create(el)))
            {
                item.IsChecked = true;
                _Tables.Add(item);
            }
            this.TableSelectAllCheckBox.IsChecked = true;
        }
        public GenerateSourceCodeWindow()
        {
            InitializeComponent();

            this.SettingGrid.DataContext = AValue.SchemaData;
            this.OutputDirectoryPathTextBox.DataContext = AValue.ConfigData.GetCurrentRecentSchemaFile();

            this.TableListBox.ItemsSource                = _Tables;
            this.StoredProcedureListBox.ItemsSource      = _StoredProcedures;
            this.UserDefinedTableTypeListBox.ItemsSource = _UserDefinedTableTypes;

            if (AValue.ConfigData.UseTableFeature)
            {
                _Tables.AddRange(AValue.SchemaData.Tables.Select(el => CheckedItem.Create(el, true)).OrderBy(el => el.Item.Name));
            }
            _StoredProcedures.AddRange(AValue.SchemaData.StoredProcedures.Select(el => CheckedItem.Create(el, true)).OrderBy(el => el.Item.Name));
            _UserDefinedTableTypes.AddRange(AValue.SchemaData.UserDefinedTableTypes.Select(el => CheckedItem.Create(el, true)).OrderBy(el => el.Item.Name));

            if (AValue.ConfigData.UseTableFeature)
            {
                this.TableSelectAllCheckBox.Visibility    = Visibility.Visible;
                this.TableListBox.Visibility              = Visibility.Visible;
                this.UseTableFeatureUnableText.Visibility = Visibility.Collapsed;
            }
            else
            {
                this.TableSelectAllCheckBox.Visibility    = Visibility.Collapsed;
                this.TableListBox.Visibility              = Visibility.Collapsed;
                this.UseTableFeatureUnableText.Visibility = Visibility.Visible;
            }

            AValue.ConfigData.GenerateSourceCodeWindow.Initialize(this);
        }
Example #3
0
 private void InitializeIgnoreObjects()
 {
     foreach (var item in AValue.SchemaData.IgnoreObjects.Select(el => CheckedItem.Create(el)))
     {
         _IgnoreObjects.Add(item);
     }
 }
        private void ImportUserDefinedTableType(String connectionString, Int32 offsetHour)
        {
            var l  = new List <DatabaseObject>();
            var db = ImportSchemaCommand.CreateDatabaseSchemaReader(AValue.SchemaData.DatabaseServer, connectionString);

            if (db.SupportUserDefinedTableType == false)
            {
                return;
            }

            foreach (var item in db.GetUserDefinedTableTypes())
            {
                if (this.ImportAllCheckBox.IsChecked == false &&
                    item.LastAlteredTime + TimeSpan.FromHours(offsetHour) < AValue.SchemaData.LastExecuteTimeOfImportUserDefinedTableType)
                {
                    continue;
                }
                if (AValue.SchemaData.IgnoreObjects.Exists(el => el.Name == item.Name) == true)
                {
                    continue;
                }

                l.Add(item);
            }

            _UserDefinedTableTypes.Clear();
            foreach (var item in l.Select(el => CheckedItem.Create(el)))
            {
                item.IsChecked = this.UserDefinedTableTypeSelectAllCheckBox.IsChecked ?? item.IsChecked;
                _UserDefinedTableTypes.Add(item);
            }
        }
        public ActionResult SaveChecked(ChecklistChecked chlist)
        {
            var checkedItem = new CheckedItem();

            var item = _itemService.GetCheckListItemById(chlist.ID);

            if (item == null)
            {
                return(JsonResponse.GetJsonResult(JsonResponse.ERROR_RESPONSE, item));
            }

            var user = _userService.GetUserById(chlist.IDUser);

            if (user == null)
            {
                return(JsonResponse.GetJsonResult(JsonResponse.ERROR_RESPONSE, user));
            }

            checkedItem.CheckListItem = item;
            checkedItem.User          = user;

            _checkedItemService.UpdateCheckedItem(checkedItem);
            _checkedItemService.SaveCheckedItem();

            return(JsonResponse.GetJsonResult(JsonResponse.OK_DATA_RESPONSE, "OK"));
        }
Example #6
0
        void SelectProviderCommand_ExecuteTargets(object obj)
        {
            CheckedItem <Provider> provider = obj as CheckedItem <Provider>;

            if (provider != null && provider.Item.Id != Guid.Empty)
            {
                this.Resolver = provider.Item.Resolver;
            }
        }
Example #7
0
            public int CompareTo(object obj)
            {
                CheckedItem ci = obj as CheckedItem;

                if (ci != null && this.obj is IComparable)
                {
                    return(((IComparable)this.obj).CompareTo(ci.obj));
                }
                return(-1);
            }
Example #8
0
        public GenerateSourceCodeWindow()
        {
            InitializeComponent();

            this.SettingGrid.DataContext = AValue.SchemaData;
            this.OutputDirectoryPathTextBox.DataContext = AValue.ConfigData.GetCurrentRecentSchemaFile();

            this.TableListBox.ItemsSource                = _Tables;
            this.StoredProcedureListBox.ItemsSource      = _StoredProcedures;
            this.UserDefinedTableTypeListBox.ItemsSource = _UserDefinedTableTypes;

            _Tables.AddRange(AValue.SchemaData.Tables.Select(el => CheckedItem.Create(el, true)).OrderBy(el => el.Item.Name));
            _StoredProcedures.AddRange(AValue.SchemaData.StoredProcedures.Select(el => CheckedItem.Create(el, true)).OrderBy(el => el.Item.Name));
            _UserDefinedTableTypes.AddRange(AValue.SchemaData.UserDefinedTableTypes.Select(el => CheckedItem.Create(el, true)).OrderBy(el => el.Item.Name));

            AValue.ConfigData.GenerateSourceCodeWindow.Initialize(this);
        }
Example #9
0
        //This method records the form selections to the preferences object, then tells the object to save
        private void savePreferences()
        {
            preferences.RunOnStartup = cb_RunOnStartup.Checked;

            preferences.Monitor1Disable = false;
            preferences.Monitor2Disable = false;
            preferences.Monitor3Disable = false;
            preferences.Monitor4Disable = false;
            preferences.Monitor5Disable = false;

            foreach (var CheckedItem in clb_monitors.CheckedItems)
            {
                int displayNo = Int32.Parse(Regex.Match(CheckedItem.ToString().Substring(7, 8), @"\d+").Value);

                Console.WriteLine("Display " + displayNo + " is set to be disabled.");

                if (displayNo == 1)
                {
                    preferences.Monitor1Disable = true;
                }
                else if (displayNo == 2)
                {
                    preferences.Monitor2Disable = true;
                }
                else if (displayNo == 3)
                {
                    preferences.Monitor3Disable = true;
                }
                else if (displayNo == 4)
                {
                    preferences.Monitor4Disable = true;
                }
                else if (displayNo == 5)
                {
                    preferences.Monitor5Disable = true;
                }
            }

            //Save
            preferences.save();
        }
Example #10
0
 private void Flags_OnChecked(CheckedItem item, DialogCheckedList dialog)
 {
     // If checked has been enabled
     if (item.Second)
     {
         switch ((Flags)item.First.First)
         {
             case Flags.IsWatched:
                 dialog.SetChecked((int)Flags.NotWatched, false);
                 break;
             case Flags.NotWatched:
                 dialog.SetChecked((int)Flags.IsWatched, false);
                 break;
             case Flags.OfflineTitles:
                 dialog.SetChecked((int)Flags.OnlineTitles, false);
                 break;
             case Flags.OnlineTitles:
                 dialog.SetChecked((int)Flags.OfflineTitles, false);
                 break;
         }
     }
 }
        private void ImportStoredProcedure()
        {
            DatabaseSchemaReader db = DatabaseSchemaReader.Create(AValue.SchemaData.DatabaseServer, this.GetSelectedConnectionString());
            var l = db.GetStoredProcedures().ToList();

            _StoredProcedures.Clear();
            foreach (var item in AValue.SchemaData.StoredProcedures.Where(el => l.Exists(sp => sp.Name == el.Name) == false).Select(el => CheckedItem.Create(el)))
            {
                _StoredProcedures.Add(item);
            }
            this.StoredProcedureSelectAllCheckBox.IsChecked = true;
        }
Example #12
0
        private void ImportTable()
        {
            DatabaseSchemaReader db = ImportSchemaCommand.CreateDatabaseSchemaReader(AValue.SchemaData.DatabaseServer, this.GetSelectedConnectionString());
            var l = db.GetTables().ToList();

            _Tables.Clear();
            foreach (var item in AValue.SchemaData.Tables.Where(el => l.Exists(t => t.Name == el.Name) == false).Select(el => CheckedItem.Create(el)))
            {
                _Tables.Add(item);
            }
            this.TableSelectAllCheckBox.IsChecked = true;
        }
Example #13
0
 public void RemoveCheckedItem(CheckedItem item)
 {
     _checkedItemRepository.Delete(item);
 }
Example #14
0
 public void UpdateCheckedItem(CheckedItem item)
 {
     _checkedItemRepository.Update(item);
 }
Example #15
0
 public void CreateCheckedItem(CheckedItem item)
 {
     _checkedItemRepository.Add(item);
 }
Example #16
0
 public void Add(CheckedItem checkedItem)
 {
     _items.Add(checkedItem);
 }