Пример #1
0
        /// <summary>
        /// �����������SQL��
        /// </summary>
        /// <returns></returns>
        private string InsertR203()
        {
            string strsql = "";
            string strdealname = "", strdealtype = "0", strstatobject = "";
            string strdealitemch = "", strdealexpr = "", strmainobject = "";
            //hjh 2004.12.21
            string strdealconditem, strdealconditemch, strdealcondexpr, strdealcondhis;
            //end hjh
            //hjh 2004.12.24
            string strdealcondsql = "";
            string strgathersequence = "";
            Report.stat.QueryDeal QD;
            //end hjh
            try
            {
                if (int_ColCount != 0)
                {
                    for (int i = 0; i < int_ColCount; i++)
                    {
                        //hjh 2004.12.21
                        if (((SetSql)(tempSequenceCol[i])).strdealconditem == null)
                        {
                            strdealconditem = "";
                        }
                        else
                        {
                            strdealconditem = ((SetSql)(tempSequenceCol[i])).strdealconditem.ToString();
                        }

                        if (((SetSql)(tempSequenceCol[i])).strdealconditemch == null)
                        {
                            strdealconditemch = "";
                        }
                        else
                        {
                            strdealconditemch = ((SetSql)(tempSequenceCol[i])).strdealconditemch.ToString();
                        }

                        if (((SetSql)(tempSequenceCol[i])).strdealcondexpr == null)
                        {
                            strdealcondexpr = "1";
                        }
                        else
                        {
                            strdealcondexpr = ((SetSql)(tempSequenceCol[i])).strdealcondexpr.ToString();
                        }

                        if (((SetSql)(tempSequenceCol[i])).strdealcondhis == null)
                        {
                            strdealcondhis = "0";
                        }
                        else
                        {
                            strdealcondhis = ((SetSql)(tempSequenceCol[i])).strdealcondhis.ToString();
                        }
                        //end hjh
                        if (((SetSql)(this.tempSequenceCol[i])).strdealItemCH == null)
                        {
                            strdealitemch = "";
                        }
                        else
                        {
                            strdealitemch = ((SetSql)(this.tempSequenceCol[i])).strdealItemCH.ToString();
                        }

                        if (((SetSql)(this.tempSequenceCol[i])).strdealFieldName == null)
                        {
                            strdealname = "";
                        }
                        else
                        {
                            strdealname = ((SetSql)(this.tempSequenceCol[i])).strdealFieldName.ToString();
                        }

                        if (((SetSql)(this.tempSequenceCol[i])).strdealstyle == null)
                        {
                            strdealtype = "0";
                        }
                        else
                        {
                            strdealtype = ((SetSql)(this.tempSequenceCol[i])).strdealstyle.ToString();
                        }

                        if (((SetSql)(this.tempSequenceCol[i])).strstatObject == null)
                        {
                            strstatobject = "";
                        }
                        else
                        {
                            strstatobject = ((SetSql)(this.tempSequenceCol[i])).strstatObject.ToString();
                        }

                        if (((SetSql)(this.tempSequenceCol[i])).strdealExpr == null)
                        {
                            strdealexpr = "1";
                        }
                        else
                        {
                            strdealexpr = ((SetSql)(this.tempSequenceCol[i])).strdealExpr.ToString();
                        }

                        if (((SetSql)(this.tempSequenceCol[i])).strmainObject == null)
                        {
                            strmainobject = "";
                        }
                        else
                        {
                            strmainobject = ((SetSql)(this.tempSequenceCol[i])).strmainObject.ToString();
                        }

                        if (((SetSql)(this.tempSequenceCol[i])).strGatherSequence == null)
                        {
                            strgathersequence = "";
                        }
                        else
                        {
                            strgathersequence = ((SetSql)(this.tempSequenceCol[i])).strGatherSequence.ToString();
                        }

                        //hjh 2004.12.24
                        QD = new Report.stat.QueryDeal(0, 0, "AA01", strdealcondexpr, strdealconditem, "");
                        strdealcondsql = QD.CreatSQLCond();
                        if (strdealcondsql.Length < 5)
                        {
                            strdealcondsql = "";
                        }
                        //end hjh
                        //hjh 2004.12.21
                        strsql += " insert into " + SEQUENCETABLE
                            + " (" + SEQUENCE_TYPENO + "," + SEQUENCE_SETTABLENO +
                            "," + SEQUENCE_TABLENO + "," + SEQUENCE_SERIALNO +
                            "," + SEQUENCE_SEQUENCENAME + "," + SEQUENCE_SEQUENCENO +
                            "," + SEQUENCE_BASEEXPR + "," + SEQUENCE_SETSQL +
                            "," + SEQUENCE_BASEITEM + "," + SEQUENCE_CHINESEITEM +
                            "," + SEQUENCE_SEQUENCETYPE + "," + SEQUENCE_DEALFIELDNAME +
                            "," + SEQUENCE_DEALSTYlE + "," + SEQUENCE_STATOBJECT +
                            "," + SEQUENCE_DEALEXPR + "," + SEQUENCE_DEALITEMCH
                            + ",mainobject,dealconditem,dealconditemch,dealcondexpr,dealcondhis,dealcondsql,gathersequence" +
                            ")	values(" + int_TypeNo + "," + int_SetTableNo +
                            "," + int_TableNo + "," + "2" +
                            "," + (char)34 + ((SetSql)(this.tempSequenceCol[i])).strName.ToString() + (char)34 + "," + i +
                            "," + (char)34 + ((SetSql)(this.tempSequenceCol[i])).strExpr + (char)34 + "," +
                            (char)34 + ((SetSql)(this.tempSequenceCol[i])).strSetSql + (char)34 + "," +
                            (char)34 + ((SetSql)(this.tempSequenceCol[i])).strItem.ToString() + (char)34 + "," +
                            (char)34 + ((SetSql)(this.tempSequenceCol[i])).strItemCH.ToString() + (char)34 + "," +
                            (char)34 + ((SetSql)(this.tempSequenceCol[i])).strSequenceType.ToString() + (char)34 + "," +
                            (char)34 + strdealname + (char)34 + "," + (char)34 + strdealtype + (char)34 + "," +
                            (char)34 + strstatobject + (char)34 + "," + (char)34 + strdealexpr + (char)34 + "," +
                            (char)34 + strdealitemch + (char)34 + "," + (char)34 + strmainobject + (char)34 + "," +
                            (char)34 + strdealconditem + (char)34 + "," + (char)34 + strdealconditemch + (char)34
                            + ",'" + strdealcondexpr + "','" + strdealcondhis + "'," + (char)34 + strdealcondsql + (char)34
                            + ",'" + strgathersequence + "') ";
                    }
                }
                if (int_RowCount != 0)
                {
                    for (int j = 0; j < int_RowCount; j++)
                    {
                        //hjh 2004.12.21
                        if (((SetSql)(tempSequenceRow[j])).strdealconditem == null)
                        {
                            strdealconditem = "";
                        }
                        else
                        {
                            strdealconditem = ((SetSql)(tempSequenceRow[j])).strdealconditem.ToString();
                        }

                        if (((SetSql)(tempSequenceRow[j])).strdealconditemch == null)
                        {
                            strdealconditemch = "";
                        }
                        else
                        {
                            strdealconditemch = ((SetSql)(tempSequenceRow[j])).strdealconditemch.ToString();
                        }

                        if (((SetSql)(tempSequenceRow[j])).strdealcondexpr == null)
                        {
                            strdealcondexpr = "1";
                        }
                        else
                        {
                            strdealcondexpr = ((SetSql)(tempSequenceRow[j])).strdealcondexpr.ToString();
                        }

                        if (((SetSql)(tempSequenceRow[j])).strdealcondhis == null)
                        {
                            strdealcondhis = "0";
                        }
                        else
                        {
                            strdealcondhis = ((SetSql)(tempSequenceRow[j])).strdealcondhis.ToString();
                        }
                        //end hjh
                        if (((SetSql)(this.tempSequenceRow[j])).strdealItemCH == null)
                        {
                            strdealitemch = "";
                        }
                        else
                        {
                            strdealitemch = ((SetSql)(this.tempSequenceRow[j])).strdealItemCH.ToString();
                        }

                        if (((SetSql)(this.tempSequenceRow[j])).strdealFieldName == null)
                        {
                            strdealname = "";
                        }
                        else
                        {
                            strdealname = ((SetSql)(this.tempSequenceRow[j])).strdealFieldName.ToString();
                        }

                        if (((SetSql)(this.tempSequenceRow[j])).strdealstyle == null)
                        {
                            strdealtype = "0";
                        }
                        else
                        {
                            strdealtype = ((SetSql)(this.tempSequenceRow[j])).strdealstyle.ToString();
                        }

                        if (((SetSql)(this.tempSequenceRow[j])).strstatObject == null)
                        {
                            strstatobject = "";
                        }
                        else
                        {
                            strstatobject = ((SetSql)(this.tempSequenceRow[j])).strstatObject.ToString();
                        }

                        if (((SetSql)(this.tempSequenceRow[j])).strdealExpr == null)
                        {
                            strdealexpr = "";
                        }
                        else
                        {
                            strdealexpr = ((SetSql)(this.tempSequenceRow[j])).strdealExpr.ToString();
                        }
                        if (((SetSql)(this.tempSequenceRow[j])).strmainObject == null)
                        {
                            strmainobject = "";
                        }
                        else
                        {
                            strmainobject = ((SetSql)(this.tempSequenceRow[j])).strmainObject.ToString();
                        }

                        if (((SetSql)(this.tempSequenceRow[j])).strGatherSequence == null)
                        {
                            strgathersequence = "";
                        }
                        else
                        {
                            strgathersequence = ((SetSql)(this.tempSequenceRow[j])).strGatherSequence.ToString();
                        }

                        //hjh 2004.12.24
                        QD = new Report.stat.QueryDeal(0, 0, "AA01", strdealcondexpr, strdealconditem, "");
                        strdealcondsql = QD.CreatSQLCond();
                        if (strdealcondsql.Length < 5)
                        {
                            strdealcondsql = "";
                        }
                        //end hjh

                        //hjh 2004.12.21
                        strsql += " insert into " + SEQUENCETABLE
                            + " (" + SEQUENCE_TYPENO + "," + SEQUENCE_SETTABLENO +
                            "," + SEQUENCE_TABLENO + "," + SEQUENCE_SERIALNO +
                            "," + SEQUENCE_SEQUENCENAME + "," + SEQUENCE_SEQUENCENO +
                            "," + SEQUENCE_BASEEXPR + "," + SEQUENCE_SETSQL +
                            "," + SEQUENCE_BASEITEM + "," + SEQUENCE_CHINESEITEM +
                            "," + SEQUENCE_SEQUENCETYPE + "," + SEQUENCE_DEALFIELDNAME +
                            "," + SEQUENCE_DEALSTYlE + "," + SEQUENCE_STATOBJECT +
                            "," + SEQUENCE_DEALEXPR + "," + SEQUENCE_DEALITEMCH
                            + ",mainobject,dealconditem,dealconditemch,dealcondexpr,dealcondhis,dealcondsql,gathersequence" +
                            ")	values(" + int_TypeNo + "," + int_SetTableNo +
                            "," + int_TableNo + "," + "1" +
                            "," + (char)34 + ((SetSql)(this.tempSequenceRow[j])).strName.ToString() + (char)34 + "," + j +
                            "," + (char)34 + ((SetSql)(this.tempSequenceRow[j])).strExpr + (char)34 +
                            "," + (char)34 + ((SetSql)(this.tempSequenceRow[j])).strSetSql + (char)34 + "," +
                            (char)34 + ((SetSql)(this.tempSequenceRow[j])).strItem.ToString() + (char)34 + "," +
                            (char)34 + ((SetSql)(this.tempSequenceRow[j])).strItemCH.ToString() + (char)34 + "," +
                            (char)34 + ((SetSql)(this.tempSequenceRow[j])).strSequenceType.ToString() + (char)34 + "," +
                            (char)34 + strdealname + (char)34 + "," + (char)34 + strdealtype + (char)34 + "," +
                            (char)34 + strstatobject + (char)34 + "," + (char)34 + strdealexpr + (char)34 + "," +
                            (char)34 + strdealitemch + (char)34 + "," + (char)34 + strmainobject + (char)34 + "," +
                            (char)34 + strdealconditem + (char)34 + "," + (char)34 + strdealconditemch + (char)34
                            + ",'" + strdealcondexpr + "','" + strdealcondhis + "'," + (char)34 + strdealcondsql + (char)34
                            + ",'" + strgathersequence + "') ";
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception("GetRestrictionExpressValue: " + e.Message);
            }

            return strsql;
        }
Пример #2
0
        /// <summary>
        /// ����Where���Sql���,��Select,���ض���ı���Za0100,�磺select AA01.ZA0100 from AA01 where [AA01.ZA0100]='05';
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="MainObject"></param>
        /// <param name="?"></param>
        /// <returns></returns>
        public string gsGetQueryResult(string MainObject,string BaseExpr,string BaseItem)
        {
            string SelectSql="";

            try
            {

                DMServer.Common.ConfigMy.ConnectInfo=ConnectInfo;
                Report.stat.QueryDeal myQueryDeal=new Report.stat.QueryDeal(MainObject,BaseExpr,BaseItem,"");

                SelectSql=myQueryDeal.QueryResult();

                return SelectSql;
            }
            catch(Exception e)
            {
                throw new Exception (e.Message );
            }
        }