/// <summary> /// 添加常量表 /// </summary> /// <returns></returns> public int insertConstEF01(string strconstname, string strconstvaluename) { int iRes; string strInsertSql, strInsertConstValue; string strConstNo, strValue; SqlCommand insertCmd = new SqlCommand(); strConstNo = getsql.GetRestrictionExpressValue(EF01_TABLE, EF01_ZA0100, getsql.getValues(EF01_TABLE, EF01_ZA0100)); strInsertSql = " insert into " + EF01_TABLE + " (" + EF01_ZA0100 + "," + EF01_EF01ID + "," + EF01_ZA0101 + ") values('" + strConstNo + "'," + maxEF01(EF01_TABLE, EF01_EF01ID) + ",'" + strconstname + "') "; iRes = getsql.insertgsId(EF01_TABLE, EF01_ZA0100, strConstNo); //strValue = getsql.GetRestrictionExpressValue(EB01_TABLE,EB01_ZA0100,getsql.getValues(EB01_TABLE,EB01_ZA0100)); strValue = maxEB01(EB01_TABLE, EB01_ZA0100).ToString(); strInsertConstValue = " insert into " + EB01_TABLE + " (" + EB01_ZA0100 + "," + EB01_EB01ID + "," + EB01_ZA0101 + "," + EB01_EB0111 + "," + EB01_ZB0102 + ") values('" + strValue + "'," + maxEF01(EB01_TABLE, EB01_EB01ID) + ",'" + userId + "','" + strConstNo + "','" + strconstvaluename + "') "; iRes = getsql.insertgsId(EB01_TABLE, EB01_ZA0100, strValue); insertCmd.CommandText = strInsertSql + strInsertConstValue; return(dataUnit.ExecSql(insertCmd)); }
/// <summary> /// 保存关系表达式表 /// </summary> /// <param name="strExpr"></param> /// <param name="strItem"></param> /// <param name="strchinese"></param> /// <param name="strserialName"></param> /// <param name="strusertable"></param> /// <returns></returns> public int InsertRptCond(string strExpr, string strItem, string strchinese, string strserialName, string strusertable) { string strNO; bool bl_table; //bl_table = this.CheckValue(TABLENAME, TABLEFIELD3, strserialName); //if (!bl_table) //{ // return -1; //} strNO = GetserialNo(); if ((strNO == "") || (strNO == null)) { strNO = "0"; } SqlCommand insertCmd = new SqlCommand(); insertCmd.CommandText = " SET QUOTED_IDENTIFIER OFF insert into " + TABLENAME + " (" + TABLEFIELD1 + "," + TABLEFIELD2 + "," + TABLEFIELD3 + "," + TABLEFIELD5 + "," + TABLEFIELD6 + "," + TABLEFIELD7 + "," + TABLEFIELD8 + "," + TABLEFIELD9 + ") values("+ this.TableNo + "," + strNO + "+1," + (char)34 + strserialName + (char)34 + "," + (char)34 + strExpr + (char)34 + "," + (char)34 + strItem + (char)34 + "," + (char)34 + FIELDP7 + (char)34 + "," + (char)34 + strchinese + (char)34 + "," + (char)34 + strusertable + (char)34 + ")"; return(dataUnit.ExecSql(insertCmd)); }