void AssignDBTable()
        {
            try
            {
                SolutionFolders_TablesDAL SolutionFolders_TablesDAL = new SolutionFolders_TablesDAL();
                DataRowView myRows;

                SolutionFolders_TablesDAL.UserId = Security.UserID;
                SolutionFolders_TablesDAL.FolderID = int.Parse(this.cmbSolutionFolders.SelectedValue.ToString());
                SolutionFolders_TablesDAL.FolderName = this.cmbSolutionFolders.Text;

                foreach (DataGridViewRow myRow in this.dvgUnMappedTables.Rows)
                {
                    DataGridViewCheckBoxCell myCell = (DataGridViewCheckBoxCell)myRow.Cells["clmSelect"];

                    if (myCell.Value.ToString() == "1")
                    {
                        myRows = (DataRowView)myRow.DataBoundItem;

                        SolutionFolders_TablesDAL.TableID = int.Parse(myRows["ID"].ToString());
                        SolutionFolders_TablesDAL.TableName = myRows["TableName"].ToString();

                        SolutionFolders_TablesDAL.Insert();

                    }
                }

            }
            catch (Exception ex)
            {

            }

            this.getMappedTables();
            this.GetSelectDB_Tables();
        }
        void WithdrawDBTable()
        {
            try
            {
                SolutionFolders_TablesDAL SolutionFolders_TablesDAL = new SolutionFolders_TablesDAL();
                DataRowView myRows;

                SolutionFolders_TablesDAL.FolderID = int.Parse(this.cmbSolutionFolders.SelectedValue.ToString());

                foreach (DataGridViewRow myRow in this.dvgMappedTables.Rows)
                {
                    DataGridViewCheckBoxCell myCell = (DataGridViewCheckBoxCell)myRow.Cells["clmSelectMapped"];

                    if (myCell.Value.ToString() == "1")
                    {
                        myRows = (DataRowView)myRow.DataBoundItem;

                        SolutionFolders_TablesDAL.TableID = int.Parse(myRows["ID"].ToString());

                        SolutionFolders_TablesDAL.Delete(SolutionFolders_TablesDAL.FolderID,SolutionFolders_TablesDAL.TableID);

                    }
                }

            }
            catch (Exception ex)
            {

            }

            this.getMappedTables();
            this.GetSelectDB_Tables();
        }
        void getMappedTables()
        {
            try
            {
                //DataTable myDataTable_SolutionsDBTables = new SolutionsDBTablesDAL().getList_Search(10000, 1, " SolutionsDBID= " + this.cmbSolutionsDB.SelectedValue.ToString(), "TableName");

                DataTable myDataTable_SolutionsDBTables = new SolutionFolders_TablesDAL().getMappedTables(int.Parse(this.cmbSolutions.SelectedValue.ToString()),
                                                                                                            int.Parse(this.cmbSolutionsDB.SelectedValue.ToString()),
                                                                                                            int.Parse(this.cmbSolutionFolders.SelectedValue.ToString()));

                if (myDataTable_SolutionsDBTables != null)
                {
                    this.SolutionsMappedDBTables_bindingSource.DataSource = myDataTable_SolutionsDBTables;
                }

                if (this.SolutionsMappedDBTables_bindingSource.DataSource != null)
                {
                    this.dvgMappedTables.DataSource = this.SolutionsMappedDBTables_bindingSource;
                    this.dvgMappedTables.Columns["clmTableName"].DataPropertyName = "TableName";
                }

                this.dvgMappedTables.Refresh();
                this.dvgMappedTables.Update();

            }
            catch (Exception ex)
            {

            }
        }
Ejemplo n.º 4
0
        void getSelectedTableFolder()
        {
            try
            {
                DataTable myDataTable_TableFolder = new SolutionFolders_TablesDAL().getTableFolderInfo(int.Parse(this.cmbSolutions.SelectedValue.ToString()), this.cmbDBTables.Text);

                if (myDataTable_TableFolder !=null && myDataTable_TableFolder.Rows.Count >0)
                {
                    DataRow myRow = myDataTable_TableFolder.Rows[0];

                    this.CurrentFolderName = myRow["FolderName"].ToString();
                    this.CurrentFolderId = int.Parse(myRow["FolderId"].ToString());

                    this.txtGenerateBESaveIn.Text = this.txtBaseFolder.Text + "\\" + myRow["FolderName"].ToString();
                    this.txtGenerateBENamespace.Text = myRow["NamespaceFormat"].ToString().Replace("{Parent}",this.txtProjectNamespace.Text).Replace("{FolderName}",myRow["FolderName"].ToString());

                }

            }
            catch (Exception ex)
            {

            }
        }