private void cboServer_DropDown(object sender, EventArgs e)
        {
            try
            {
                if (!isServerFilled)
                {
                    this.Cursor = Cursors.WaitCursor;
                    List <string> servers = null;

                    var t = Task.Factory.StartNew(() =>
                    {
                        servers = GetServerList();
                    });
                    if (t.IsCompleted)
                    {
                        servers.ForEach(item => cbxServer.Items.Add(item));
                        isServerFilled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                USUtil.DisplayMessage(ex.Message, USUtil.msg_ErrorCaption, false);
            }

            Cursor = Cursors.Default;
        }
 private void btnCopy_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(this.ftpTextBox.Text))
     {
         Clipboard.SetText(this.ftpTextBox.Text);
         USUtil.DisplayMessage(USUtil.msg_CopiedToClipboard, USUtil.msg_CopiedCaption, true);
     }
 }
Exemple #3
0
        private void btnGenrate_Click(object sender, EventArgs e)
        {
            try
            {
                string RootlibraryPath = USUtil.SavePath;
                FileManager.DeleteDirectory(RootlibraryPath);

                string defaultNameSpace = tbxDefaultNamespace.Text.Trim();
                if (defaultNameSpace == string.Empty)
                {
                    defaultNameSpace = USUtil.DefaultNameSpace;
                }

                if (ddlType.SelectedValue.ToString().Trim() == USUtil.Tbl || ddlType.SelectedValue.ToString().Trim() == string.Empty)
                {
                    AdonaiBuildStructureInfo buildInfo = new AdonaiBuildStructureInfo();
                    buildInfo.TableName            = txtTableName.Text.Trim();
                    buildInfo.InfoClassName        = txtClassName.Text.Trim();
                    buildInfo.ConnectionString     = ConnectionString;
                    buildInfo.IsNullableRequired   = chkIsNullableRequred.Checked;
                    buildInfo.IsSerializable       = chklsSerializable.Checked;
                    buildInfo.IsControllerRequired = chkIsController.Checked;
                    buildInfo.IsProviderRequired   = chkIsProviderRequred.Checked;
                    buildInfo.InfoNameSpace        = defaultNameSpace;
                    BELLBuilderController ctlBELL = new BELLBuilderController();
                    string output = ctlBELL.GetTableInfoByTableNameandClassName(buildInfo);

                    AddToFastNote(output);
                }
                else
                {
                    AppUtilityDataProvider dataProvider = new AppUtilityDataProvider();
                    IList <KeyValuePair <string, object> > inputParamList = dataProvider.GetSpPrametersBySpName(txtTableName.Text.Trim(), ConnectionString);
                    if (inputParamList.Count > 0)
                    {
                        IList <KeyValuePair <string, object> > listColl = new List <KeyValuePair <string, object> >();

                        ArrayList arrColl = BuildSQLParameter(inputParamList);
                        for (int i = 0; i < arrColl.Count; i++)
                        {
                            listColl.Add(new KeyValuePair <string, object>(arrColl[i].ToString(), "1"));
                        }

                        string strInfoText = dataProvider.ExecuteGivenProcedureBuildInfoClass(txtTableName.Text, tbxDefaultNamespace.Text.Trim(), txtClassName.Text.Trim(), listColl, ConnectionString);

                        AddToFastNote(strInfoText);
                    }
                    else
                    {
                        USUtil.DisplayMessage(USUtil.msg_SPHasNoParam, USUtil.msg_ErrorCaption, false);
                    }
                }
            }
            catch (Exception ex)
            {
                USUtil.DisplayMessage(ex.Message, USUtil.msg_ErrorCaption, false);
            }
        }
Exemple #4
0
        private void BindTableNames()
        {
            txtTableName.AutoCompleteMode   = AutoCompleteMode.Suggest;
            txtTableName.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection();

            namesCollection = USUtil.GetTablesFromDatabase(databaseName, ConnectionString);
            txtTableName.AutoCompleteCustomSource = namesCollection;
        }
 private void btnTest_Click(object sender, EventArgs e)
 {
     pnlInfoGenerator.Controls.Clear();
     if (TestConnection())
     {
         USUtil.DisplayMessage(USUtil.msg_TestSuccessfull, USUtil.msg_TestCaption, true);
         cboDatabase.Enabled     = true;
         cbxGenerateInfo.Enabled = true;
     }
     else
     {
         USUtil.DisplayMessage(USUtil.msg_TestFailed + "\r\n" + ErrorConnection, USUtil.msg_ErrorCaption, false);
         cboDatabase.Enabled = false;
     }
 }
Exemple #6
0
        public ctrlTableInfo(string connectionString, string databaseName, Action <string> addToFastNote)
        {
            InitializeComponent();
            this.Dock             = DockStyle.Fill;
            this.databaseName     = databaseName;
            this.ConnectionString = connectionString;
            this.AddToFastNote    = addToFastNote;

            BuinTypeDropdown();
            txtTableName.AutoCompleteMode   = AutoCompleteMode.Suggest;
            txtTableName.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection();

            namesCollection = USUtil.GetTablesFromDatabase(databaseName, connectionString);
            txtTableName.AutoCompleteCustomSource = namesCollection;
        }
        private void BindCheckBoxList()
        {
            AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection();

            namesCollection = USUtil.GetTablesFromDatabase(databaseName, ConnectionString);
            List <RandomClass> lst = new List <RandomClass>();

            for (int i = 0; i < namesCollection.Count; i++)
            {
                lst.Add(new RandomClass(namesCollection[i].ToString()));
            }

            ((ListBox)this.chkList).DataSource    = lst;
            ((ListBox)this.chkList).DisplayMember = "Name";
            ((ListBox)this.chkList).ValueMember   = "IsChecked";
        }
Exemple #8
0
        private void ddlType_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtTableName.AutoCompleteMode   = AutoCompleteMode.Suggest;
            txtTableName.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection();

            if (ddlType.SelectedValue.ToString() == USUtil.Tbl || ddlType.SelectedValue.ToString() == "")
            {
                namesCollection = USUtil.GetTablesFromDatabase(databaseName, ConnectionString);
                txtTableName.AutoCompleteCustomSource = namesCollection;
            }
            else
            {
                namesCollection = USUtil.GetStoredProcedureList(databaseName, ConnectionString);
                txtTableName.AutoCompleteCustomSource = namesCollection;
            }
        }
        private void cboDatabase_DropDown(object sender, EventArgs e)
        {
            try
            {
                if (cbxAuthentication.SelectedIndex == 1)
                {
                    if ((UserName == string.Empty) || Password == string.Empty)
                    {
                        USUtil.DisplayMessage(USUtil.msg_UNnPwd, USUtil.msg_FieldMissingCaption, false);
                        cboDatabase.DroppedDown = false;
                        return;
                    }
                }
                this.Cursor = Cursors.WaitCursor;
                FillDatabase();
            }
            catch (Exception ex)
            {
                cboDatabase.Items.Clear();
                USUtil.DisplayMessage(ex.Message, USUtil.msg_ErrorCaption, false);
            }

            this.Cursor = Cursors.Default;
        }
Exemple #10
0
        private void btnGenrate_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (txtUserName.Text.Trim() != string.Empty && txtReason.Text.Trim() != string.Empty)
                {
                    userName       = txtUserName.Text.Trim();
                    modDescription = txtReason.Text.Trim();
                    string        queryString = GetQueryCode();
                    SqlConnection conn        = new SqlConnection(ConnectionString);
                    conn.InfoMessage += Conn_InfoMessage;
                    conn.Open();

                    SqlCommand     cmd = new SqlCommand(queryString, conn);
                    SqlDataAdapter da  = new SqlDataAdapter();
                    da.SelectCommand = cmd;
                    DataSet ds = new DataSet();
                    da.Fill(ds);


                    AddToFastNote(universalExtract);
                }
                else
                {
                    USUtil.DisplayMessage("A Valid Developer Name and Description is required", "Error while processing", false);
                }
            }
            catch (SqlException ex)
            {
                USUtil.DisplayMessage(ex.Message, "SqlException", false);
            }

            this.Cursor = Cursors.Arrow;
        }