Exemple #1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder");
            string strParse = rtbQuery.Text.Trim().ToString().ToUpper();

            //  string strParse = (string)objTechArea.ParseSQLColoumns(rtbQuery.Text.Trim().ToString());

            if (strParse.Contains("@PatientId".ToUpper()))
            {
                strParse = strParse.Replace("@PatientId".ToUpper(), "0");
            }
            //else
            //{
            //    IQCareWindowMsgBox.ShowWindow("ParameterPatientId", this);
            //    return;
            //}
            strParse = (string)objTechArea.ParseSQLColoumns(strParse);

            if (strParse == "Valid Value" || strParse == "No Records")
            {
                string sqlstr      = rtbQuery.Text;
                char[] charsToTrim = { ';' };
                sqlstr          = sqlstr.TrimEnd(charsToTrim);
                GblIQCare.Query = sqlstr.ToString();
                this.Close();
            }
            else
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = strParse.ToString();
                IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this);
                return;
            }
        }
Exemple #2
0
        private void btnTestQuery_Click(object sender, EventArgs e)
        {
            if (rtbQuery.Text.Trim() == "")
            {
                IQCareWindowMsgBox.ShowWindow("BlankQuery", this);
                return;
            }

            try
            {
                //objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder");
                string strParse = rtbQuery.Text.Trim().ToString().ToUpper();
                if (strParse.Contains("@PatientId".ToUpper()))
                {
                    strParse = strParse.Replace("@PatientId".ToUpper(), "0");
                }
                //else
                //{
                //    IQCareWindowMsgBox.ShowWindow("ParameterPatientId", this);
                //    return;
                //}

                objTechArea = (IHomePageConfiguration)ObjectFactory.CreateInstance("BusinessProcess.FormBuilder.BHomePageConfiguration,BusinessProcess.FormBuilder");
                //strParse = (string)objTechArea.ParseSQLColoumns(rtbQuery.Text.Trim().ToString());
                strParse = (string)objTechArea.ParseSQLColoumns(strParse);
                if (strParse == "Valid Value" || strParse == "No Records")
                {
                    IQCareWindowMsgBox.ShowWindow("CheckSyntax", this);
                    return;
                }
                else
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["MessageText"] = strParse.ToString();
                    IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this);
                    return;
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.ToString();
                IQCareWindowMsgBox.ShowWindow("#C1", theBuilder, this);
                return;
            }
            finally
            {
                objTechArea = null;
            }
        }