Пример #1
0
        public void Save(DataTable dt, string ID)
        {
            JTPUBQRDEFMgr defmgr = new JTPUBQRDEFMgr(mgr, ProcessID);
            JTPUBQRDEFEty ety    = defmgr.getEty(ID);
            string        sql    = "begin ";

            sql += string.Format("DELETE FROM EAZBGS WHERE F_ID='{0}' and F_DWBH=' ';", ID);
            sql += "INSERT INTO EAZBGS(F_DWBH,F_ID,F_GSBH,F_GSMC,F_CAPT,F_CAPH,F_SCAPH,F_BTGD,F_ROWH,F_BWGD,F_SPACE,F_SYBZ) ";
            sql += string.Format("VALUES (' ','{0}','01','系统格式','{1}',30,30,20,20,0,10,'0');", ID, ety.JTPUBQRDEF_TITLE);
            sql += string.Format("DELETE FROM EAOTGS WHERE F_ID='{0}'   and F_DWBH=' ';", ID);
            sql += "INSERT INTO EAOTGS(F_DWBH,F_ID,F_GSBH,F_OTBH,F_TEXT,F_OTBZ,F_JS,F_ALIGN)";
            sql += string.Format("Values(' ','{0}','01','01','{1}','H','1','L');", ID, ety.JTPUBQRDEF_SUBTIL);
            sql += string.Format("delete from EATIGS where F_ID='{0}' and F_DWBH=' ';", ID);
            if (dt.Rows.Count > 0)
            {
                /*F_DWBH,F_ID,F_FHBZ,F_GSBH,F_TIBH,F_JS,F_FIELD,F_TEXT,F_TYPE,F_ALIGN,
                 * F_WIDTH,F_PREC,F_HJBZ,F_YHBZ*/
                string vsinsert = @"INSERT INTO EATIGS(F_DWBH,F_ID,F_GSBH,F_TIBH,F_JS,F_FIELD,F_TEXT,F_TYPE,F_ALIGN,F_WIDTH,F_PROP,F_PREC,F_DISP,F_REAL,F_HJBZ,F_PXBZ,F_YHBZ,F_FHBZ,F_HZBZ,F_TSTEXT,F_GROUP,F_TSHID,F_ISGD,F_PSUMTYPE,F_FORMAT)
Values(' ','{0}','01','{1}','{2}','{3}','{4}','{5}','{6}',{7},' ','{8}',' ',' ','{9}','0','{10}','0','0','{11}','{12}','{13}','{14}','{15}','{16}');";
                foreach (DataRow row in dt.Rows)
                {
                    sql += string.Format(vsinsert, row["F_ID"].ToString(), row["F_TIBH"].ToString(), row["F_JS"].ToString(),
                                         row["F_FIELD"].ToString(), row["F_TEXT"].ToString(), row["F_TYPE"].ToString(), row["F_ALIGN"].ToString(), row["F_WIDTH"].ToString(),
                                         row["F_PREC"].ToString(), row["F_HJBZ"].ToString(), row["F_YHBZ"].ToString(),
                                         row["F_TSTEXT"].ToString(), row["F_GROUP"].ToString(), row["F_TSHID"].ToString(), row["F_ISGD"].ToString(), row["F_PSUMTYPE"].ToString(), row["F_FORMAT"].ToString());
                }
            }
            sql += " end;";
            WebSvrGetData.execsql(this.ProcessID, sql, mgr);
        }
Пример #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();
        }
Пример #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);
        }
Пример #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);
            }
        }