Esempio n. 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);
        }
Esempio n. 2
0
        private void add(JTPUBQRDEFEty ety)
        {
            string sql = @"insert into  JTPUBQRDEF
(JTPUBQRDEF_ID,JTPUBQRDEF_BH,JTPUBQRDEF_MC,JTPUBQRDEF_TITLE,JTPUBQRDEF_SUBTIL,JTPUBQRDEF_TYPE,JTPUBQRDEF_SQL,JTPUBQRDEF_DWFIELD,JTPUBQRDEF_RQFIELD,JTPUBQRDEF_WHERE,JTPUBQRDEF_DBSRC,JTPUBQRDEF_ORA)
values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}')";

            sql = string.Format(sql, ety.JTPUBQRDEF_ID, ety.JTPUBQRDEF_BH, ety.JTPUBQRDEF_MC, ety.JTPUBQRDEF_TITLE, ety.JTPUBQRDEF_SUBTIL,
                                ety.JTPUBQRDEF_TYPE, ety.JTPUBQRDEF_SQL.Replace("'", "''"), ety.JTPUBQRDEF_DWFIELD,
                                ety.JTPUBQRDEF_RQFIELD, ety.JTPUBQRDEF_WHERE, ety.JTPUBQRDEF_DBSRC, ety.JTPUBQRDEF_ORA.Replace("'", "''"));

            WebSvrGetData.execsql(this.ProcessID, sql, mgr);
        }
Esempio n. 3
0
 public void Save(JTPUBQRDEFEty ety, DataTable dtwhere)
 {
     if (string.IsNullOrEmpty(ety.JTPUBQRDEF_ID))
     {
         ety.JTPUBQRDEF_ID = System.Guid.NewGuid().ToString().Replace("-", "");
         add(ety);
     }
     else
     {
         Update(ety);
     }
     updateWhereData(ety.JTPUBQRDEF_ID, dtwhere);
 }
Esempio n. 4
0
        private void Update(JTPUBQRDEFEty ety)
        {
            string sql = @"begin 
update JTPUBQRDEF  set JTPUBQRDEF_BH='{1}',JTPUBQRDEF_MC='{2}',JTPUBQRDEF_TITLE='{3}',JTPUBQRDEF_SUBTIL='{4}',JTPUBQRDEF_TYPE='{5}',
JTPUBQRDEF_SQL='{6}',JTPUBQRDEF_DWFIELD='{7}',JTPUBQRDEF_RQFIELD ='{8}',JTPUBQRDEF_WHERE='{9}',JTPUBQRDEF_DBSRC='{10}',JTPUBQRDEF_ORA='{11}'
where JTPUBQRDEF_ID='{0}' ;";

            sql = string.Format(sql, ety.JTPUBQRDEF_ID, ety.JTPUBQRDEF_BH, ety.JTPUBQRDEF_MC, ety.JTPUBQRDEF_TITLE, ety.JTPUBQRDEF_SUBTIL,
                                ety.JTPUBQRDEF_TYPE, ety.JTPUBQRDEF_SQL.Replace("'", "''"), ety.JTPUBQRDEF_DWFIELD, ety.JTPUBQRDEF_RQFIELD,
                                ety.JTPUBQRDEF_WHERE, ety.JTPUBQRDEF_DBSRC, ety.JTPUBQRDEF_ORA.Replace("'", "''"));

            sql += string.Format("DELETE FROM EAOTGS WHERE F_ID='{0}';", ety.JTPUBQRDEF_ID);
            sql += "INSERT INTO EAOTGS(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');", ety.JTPUBQRDEF_ID, ety.JTPUBQRDEF_SUBTIL);
            sql += " end; ";
            WebSvrGetData.execsql(this.ProcessID, sql, mgr);
        }
Esempio n. 5
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();
        }
Esempio n. 6
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);
        }
Esempio n. 7
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);
            }
        }
Esempio n. 8
0
        public JTPUBQRDEFEty getEty(string id)
        {
            JTPUBQRDEFEty ety = new JTPUBQRDEFEty();
            string        sql = "select * from JTPUBQRDEF where JTPUBQRDEF_ID='{0}'";

            sql = string.Format(sql, id);
            DataTable dt = getDataTable(sql);

            if (dt.Rows.Count > 0)
            {
                ety.JTPUBQRDEF_ID      = dt.Rows[0]["JTPUBQRDEF_ID"].ToString();
                ety.JTPUBQRDEF_BH      = dt.Rows[0]["JTPUBQRDEF_BH"].ToString();
                ety.JTPUBQRDEF_MC      = dt.Rows[0]["JTPUBQRDEF_MC"].ToString();
                ety.JTPUBQRDEF_TITLE   = dt.Rows[0]["JTPUBQRDEF_TITLE"].ToString();
                ety.JTPUBQRDEF_SUBTIL  = dt.Rows[0]["JTPUBQRDEF_SUBTIL"].ToString();
                ety.JTPUBQRDEF_TYPE    = dt.Rows[0]["JTPUBQRDEF_TYPE"].ToString();
                ety.JTPUBQRDEF_DBSRC   = dt.Rows[0]["JTPUBQRDEF_DBSRC"].ToString();
                ety.JTPUBQRDEF_SQL     = dt.Rows[0]["JTPUBQRDEF_SQL"].ToString();
                ety.JTPUBQRDEF_ORA     = dt.Rows[0]["JTPUBQRDEF_ORA"].ToString();
                ety.JTPUBQRDEF_RQFIELD = dt.Rows[0]["JTPUBQRDEF_RQFIELD"].ToString();
                ety.JTPUBQRDEF_WHERE   = dt.Rows[0]["JTPUBQRDEF_WHERE"].ToString();
            }
            return(ety);
        }