Exemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!getCtrlValue())
            {
                return;
            }
            defMgr.Save(ety, DtWhere);

            MessageBox.Show("保存成功");
            DtWhere = defMgr.getWhereDt(ety.JTPUBQRDEF_ID);
            gridControl1.DataSource = DtWhere.DefaultView;
            btnParamEnabled();
            // string sql = insertDefineParam();
            // if (!string.IsNullOrEmpty(sql))
            // {
            //    WebSvrGetData.execsql(this.ProcessID, sql, mgr);
            //}
        }
Exemplo n.º 2
0
        private void frmDefEdit_Load(object sender, EventArgs e)
        {
            DataTable dtsrc = mgr.getDataSet(DevQryPubFun.GSYDBSrc, "select * from GSYDTSRC").Tables[0];

            foreach (DataRow row in dtsrc.Rows)
            {
                JTPUBQRDEF_DBSRC.Properties.Items.Add(row["GSYDTSRC_ID"].ToString());
            }
            JTPUBQRDEF_DBSRC.Properties.Items.Add(DevQryPubFun.GSYDBSrc);
            defMgr = new JTPUBQRDEFMgr(mgr, this.ProcessID);
            if (!string.IsNullOrEmpty(ID))
            {
                ety = defMgr.getEty(ID);
                setCtrlValue();
            }
            DtWhere = defMgr.getWhereDt(ID);
            gridControl1.DataSource = DtWhere.DefaultView;
            btnParamEnabled();
        }
Exemplo n.º 3
0
        private DataTable getQryData()
        {
            JTPUBQRDEFMgr defmgr = new JTPUBQRDEFMgr(mgr, ProcessID);
            JTPUBQRDEFEty ety    = defmgr.getEty(this.ID);
            DataTable     dt     = null;

            if (ety.JTPUBQRDEF_TYPE.ToUpper() == "SQL")
            {
                string sql = ety.JTPUBQRDEF_SQL + "  " + ety.JTPUBQRDEF_WHERE;
                if (mgr.getDBType(ety.JTPUBQRDEF_DBSRC) == "ORA")
                {
                    sql = ety.JTPUBQRDEF_ORA + "  " + ety.JTPUBQRDEF_WHERE;
                }
                dt = getDataTable(sql, ety.JTPUBQRDEF_DBSRC);
            }
            else
            {
                string[]  paramArr = null;
                string[]  valueArr = null;
                DataTable dtwhere  = defmgr.getWhereDt(this.ID);
                if (dtwhere.Rows.Count > 0)
                {
                    paramArr = new string[dtwhere.Rows.Count];
                    valueArr = new string[dtwhere.Rows.Count];
                    for (int i = 0; i < dtwhere.Rows.Count; i++)
                    {
                        paramArr[i] = dtwhere.Rows[i]["PARAMDEF_NAME"].ToString();
                        valueArr[i] = "";
                    }
                }
                string proc = ety.JTPUBQRDEF_SQL;
                if (mgr.getDBType(ety.JTPUBQRDEF_DBSRC) == "ORA")
                {
                    proc = ety.JTPUBQRDEF_ORA;
                }
                dt = WebSvrGetData.getDataTable(ety.JTPUBQRDEF_DBSRC, ety.JTPUBQRDEF_SQL, paramArr, valueArr, mgr);
            }
            return(dt);
        }
Exemplo n.º 4
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            JTPUBQRDEFMgr defmgr = new JTPUBQRDEFMgr(mgr, ProcessID);
            JTPUBQRDEFEty ety    = defmgr.getEty(this.ID);
            DevQryShow    frm    = new DevQryShow();

            if (ety.JTPUBQRDEF_TYPE.ToUpper() == "SQL")
            {
                string sql = ety.JTPUBQRDEF_SQL;
                if (mgr.getDBType(ety.JTPUBQRDEF_DBSRC) == "ORA")
                {
                    sql = ety.JTPUBQRDEF_ORA;
                }
                frm.showWithParam(ety.JTPUBQRDEF_DBSRC, " ", " ", "", this.ID, "", "2", "2", "", sql, ety.JTPUBQRDEF_SUBTIL, "0", " ");
            }
            else
            {
                string    vsParam = "";
                string    vsValue = "";
                DataTable dtwhere = defmgr.getWhereDt(this.ID);
                if (dtwhere.Rows.Count > 0)
                {
                    for (int i = 0; i < dtwhere.Rows.Count; i++)
                    {
                        vsParam += "^" + dtwhere.Rows[i]["PARAMDEF_NAME"].ToString();
                        vsValue += "^";
                    }
                    vsParam = vsParam.Substring(1);
                    vsValue = vsValue.Substring(1);
                }
                string proc = ety.JTPUBQRDEF_SQL;
                if (mgr.getDBType(ety.JTPUBQRDEF_DBSRC) == "ORA")
                {
                    proc = ety.JTPUBQRDEF_ORA;
                }
                frm.showProc(ety.JTPUBQRDEF_DBSRC, " ", " ", "", this.ID, "", "2", "2", "", proc, ety.JTPUBQRDEF_SUBTIL, "0", vsParam, vsValue);
            }
        }