Beispiel #1
0
        public void AddItemsToComboBox()
        {
            DODatabaseFunctions df = new DODatabaseFunctions();

            dbinfoitems = df.GetDatabaseInfo();
            foreach (DatabaseInfoList item in dbinfoitems)
            {
                comboBoxViewName.Items.Add(item.UniqueName);
            }
        }
Beispiel #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!InputValidation())
            {
                return;
            }

            if (!CheckforDuplicates())
            {
                return;
            }

            string ErrorMessage = null;

            DODatabaseFunctions df = new DODatabaseFunctions();

            df.InsertDatabaseInfo(ViewName, ServerName, UserID, Password, DBName, out ErrorMessage);
        }
Beispiel #3
0
        private bool CheckforDuplicates()
        {
            DODatabaseFunctions     df        = new DODatabaseFunctions();
            List <DatabaseInfoList> alldbinfo = df.GetDatabaseInfo();

            foreach (var dbinfo in alldbinfo)
            {
                if (dbinfo.UniqueName == ViewName)
                {
                    CommonUtilities.ErrorMessage("View Name already exists. Please input another view name.");
                    return(false);
                }

                if (dbinfo.ServerName == ServerName && dbinfo.DatabaseName == DBName)
                {
                    CommonUtilities.ErrorMessage("Same server and database already exists.");
                    return(false);
                }
            }
            return(true);
        }