Ejemplo n.º 1
0
        private void cmdOpOk_Click(object sender, EventArgs e)
        {
            StringBuilder theErrorMsg = new StringBuilder();

            if (Convert.ToInt32(cmbOpCategory.SelectedValue) < 0)
            {
                theErrorMsg.Append("Select Report Category first.").AppendLine();
            }
            if (Convert.ToInt32(cmbOpRepName.SelectedValue) < 0)
            {
                theErrorMsg.Append("Select Report Name first.").AppendLine();
            }
            if (theErrorMsg.Length > 0)
            {
                MessageBox.Show("Following are mandatory:" + theErrorMsg.ToString(), "IQCare Management", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            DataTable theDt = (DataTable)cmbOpRepName.DataSource;
            DataView  theDV = new DataView(theDt);

            theDV.RowFilter = "CategoryId= " + cmbOpCategory.SelectedValue + " and ReportId = " + cmbOpRepName.SelectedValue;
            if (theDV.Count > 0)
            {
                QBControl.Clear();
                txtQBQuery.Text = "";
                txtQBQuery.Text = theDV[0]["ReportQuery"].ToString();
                ReportId        = Convert.ToInt32(theDV[0]["ReportId"]);
                CategoryId      = Convert.ToInt32(theDV[0]["CategoryId"]);
                RepName         = theDV[0]["ReportName"].ToString();
            }
            QBControl.Enabled = true;
            pnlOpen.Visible   = false;
        }
Ejemplo n.º 2
0
        private void SetQueryBuilderConnection()
        {
            IQueryBuilder theQBuilder   = (IQueryBuilder)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BQueryBuilder, BusinessProcess.FormBuilder");
            SqlConnection theConnection = theQBuilder.GetConnectionQueryBuilder();

            mssqlMetadataProvider1.Connection = theConnection;

            QBControl.MetadataProvider        = mssqlMetadataProvider1;
            QBControl.SyntaxProvider          = universalSyntaxProvider1;
            plainTextSQLBuilder1.QueryBuilder = QBControl;
            QBControl.RefreshMetadata();
        }
Ejemplo n.º 3
0
 private void Init_Form()
 {
     txtQBQuery.Text        = "";
     txtNewCategory.Text    = "";
     txtReportName.Text     = "";
     ReportId               = 0;
     CategoryId             = 0;
     RepName                = "";
     txtNewCategory.Visible = false;
     pnlSave.Visible        = false;
     pnlOpen.Visible        = false;
     tbQBuilder.Focus();
     QBControl.Clear();
 }
Ejemplo n.º 4
0
        private void SetQueryBuilderConnection()
        {
            IQueryBuilder theQBuilder   = (IQueryBuilder)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BQueryBuilder, BusinessProcess.FormBuilder");
            SqlConnection theConnection = theQBuilder.GetConnectionQueryBuilder();

            mssqlMetadataProvider1.Connection = theConnection;

            QBControl.MetadataProvider        = mssqlMetadataProvider1;
            QBControl.SyntaxProvider          = mssqlSyntaxProvider1;
            plainTextSQLBuilder1.QueryBuilder = QBControl;
            txtQBQuery.QueryBuilder           = QBControl;

            QBControl.ExpressionEditor     = expressionEditor1;
            expressionEditor1.QueryBuilder = QBControl;
            QBControl.InitializeDatabaseSchemaTree();
        }
Ejemplo n.º 5
0
 private void frmQueryBuilder_Load(object sender, EventArgs e)
 {
     try
     {
         Init_Form();
         clsCssStyle theStyle = new clsCssStyle();
         theStyle.setStyle(this);
         SetQueryBuilderConnection();
         QBControl.RefreshMetadata();
     }
     catch (Exception err)
     {
         MsgBuilder Builder = new MsgBuilder();
         Builder.DataElements["MessageText"] = err.Message.ToString();
         IQCareWindowMsgBox.ShowWindow("#C1", Builder, this);
     }
 }