//public ScriptConfigCtrl(ref SqlSyncBuildData.ScriptRow scriptConfig, string[] databaseList)
 //{
 //    InitializeComponent();
 //    this.scriptConfig = scriptConfig;
 //    this.databaseList = databaseList;
 //    SetUp();
 //}
 public void SetConfigData(ref SqlSyncBuildData.ScriptRow scriptConfig, DatabaseList databaseList, List <string> tagList, bool tagRequired)
 {
     this.scriptConfig = scriptConfig;
     this.databaseList = databaseList;
     this.tagList      = tagList;
     this.tagRequired  = tagRequired;
     SetUp();
 }
        private void ImportListForm_Load(object sender, System.EventArgs e)
        {
            bool foundConflict = false;
            bool selectAllValid;

            if (this.preSelectedFiles.Length > 0)
            {
                selectAllValid = false;
            }
            else
            {
                selectAllValid = true;
            }

            System.Data.DataView importView = this.importData.Script.DefaultView;
            importView.Sort           = "BuildOrder ASC";
            importView.RowStateFilter = System.Data.DataViewRowState.OriginalRows;

            for (int i = 0; i < importView.Count; i++)
            {
                SqlSyncBuildData.ScriptRow row = (SqlSyncBuildData.ScriptRow)importView[i].Row;

                ListViewItem item = new ListViewItem(new string[] { row.FileName, row.Database, row.ScriptId, System.IO.Path.Combine(this.importTempPath, row.FileName) });
                item.Checked = false;

                if (this.buildData.Script.Select(
                        "ScriptId = '" + row.ScriptId + "' OR " +
                        "FileName = '" + row.FileName + "'").Length > 0)
                {
                    item.Checked   = false;
                    item.BackColor = Color.Red;
                    foundConflict  = true;
                }
                else if (selectAllValid)
                {
                    item.Checked = true;
                }
                else
                {
                    for (int j = 0; j < this.preSelectedFiles.Length; j++)
                    {
                        if (this.preSelectedFiles[j].ToLower() == row.FileName.ToLower())
                        {
                            item.Checked = true;
                            break;
                        }
                    }
                }


                this.lstImport.Items.Add(item);
            }

            if (foundConflict)
            {
                MessageBox.Show("A matching entry was already found. Please review list before accepting.", "Please Review List", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Example #3
0
 public RenameScriptForm(ref SqlSyncBuildData.ScriptRow scriptRow)
 {
     InitializeComponent();
     this.scriptRow = scriptRow;
 }