コード例 #1
0
        Boolean isQueryExist(string TableName, string QueryName)
        {
            SolutionsDBQueryDAL SolutionsDBQueryDAL = new DAL.SolutionsDBQueryDAL();
            Boolean isExist = SolutionsDBQueryDAL.isQueryExist(this.CurrentDBID, TableName, QueryName);

            if (isExist)
            {
                CommonClasses.Messages.GeneralError("Query with name \" " + QueryName + " \" already exists", " Insert Query");
            }

            return isExist;
        }
コード例 #2
0
        void getList_SolutionQueryDB(string TableName)
        {
            try
            {
                //this.SolutionDBQuery_bindingSource.DataSource = null;
                //this.dvgSolutionDBQuery.DataSource = null;
                //this.dvgSolutionDBQuery.DataBindings.Clear();

                //this.txtGeneratedQuery.DataBindings.Clear();
                //this.txtQueryName.DataBindings.Clear();
                //this.txtActionType.DataBindings.Clear();
                //this.txtQueryType.DataBindings.Clear();

                string WhereCondition = string.Empty;

                WhereCondition = " TableName like '" + TableName + "' and SolutionsDBID=" + CurrentDBID;

                DataTable myDataTable_SolutinsDBQuery = new DAL.SolutionsDBQueryDAL().getList_Search(1000, 1, WhereCondition, "ID", "Desc");

                if (myDataTable_SolutinsDBQuery != null) //&& myDataTable_SolutinsDBQuery.Rows.Count > 0
                {
                    this.SolutionDBQuery_bindingSource.DataSource = myDataTable_SolutinsDBQuery;

                }
                else
                {
                    this.SolutionDBQuery_bindingSource.DataSource = null;
                    this.dvgSolutionDBQuery.DataSource = null;
                }

                if (this.SolutionDBQuery_bindingSource.DataSource != null && this.isMapped==false )
                {
                    this.isMapped = true;
                    this.dvgSolutionDBQuery.DataSource = this.SolutionDBQuery_bindingSource;
                    this.dvgSolutionDBQuery.Columns["clmQueryName"].DataPropertyName = "QueryName";

                    this.txtGeneratedQuery.DataBindings.Add("Text", this.SolutionDBQuery_bindingSource, "QueryText");
                    this.txtQueryName.DataBindings.Add("Text", this.SolutionDBQuery_bindingSource, "QueryName");
                    this.txtActionType.DataBindings.Add("Text", this.SolutionDBQuery_bindingSource, "ActionType");
                    this.txtQueryType.DataBindings.Add("Text", this.SolutionDBQuery_bindingSource, "QueryType");

                }

            }
            catch (Exception ex)
            {
                CommonClasses.Messages.GeneralError(ex.Message, " Get Query List");
            }
        }
コード例 #3
0
        void Insert_SolutionsDBQuery(string TableName, string QueryName, string ActionType, string QueryType, string QueryText, Boolean refreshGrid)
        {
            try
            {
                SolutionsDBQueryDAL SolutionsDBQueryDAL = new DAL.SolutionsDBQueryDAL();

                SolutionsDBQueryDAL.SolutionsDBID = this.CurrentDBID;
                SolutionsDBQueryDAL.TableName = TableName;
                SolutionsDBQueryDAL.QueryName = QueryName;
                SolutionsDBQueryDAL.ActionType = ActionType;
                SolutionsDBQueryDAL.QueryType = QueryType;
                SolutionsDBQueryDAL.QueryText = QueryText;
                SolutionsDBQueryDAL.isActive = true;
                SolutionsDBQueryDAL.UserId = CommonClasses.Security.UserID;

                SolutionsDBQueryDAL.Insert();

                if (refreshGrid == true)
                {
                    this.getList_SolutionQueryDB(TableName);
                }

            }
            catch (Exception ex)
            {
                CommonClasses.Messages.GeneralError(ex.Message, " Insert Query");
            }
        }