Esempio n. 1
0
        public static bool Update(SqlBaseItemXml basemodel, long rowid, SqlServerItemXml servermodel, SqlDatabaseItemXml databasemodel, SqlTableItemXml tablemodel, Dictionary <string, object> updatefieldlist)
        {
            bool   revalue = false;
            string connstr = GetConnStr(basemodel, servermodel);
            string sqlstr  = string.Format("update {0}.dbo.{1} set {4} where {2}={3}", databasemodel.DatabaseName, tablemodel.TableName, basemodel.PrimarykeyName, rowid, GetSqlUpdate(basemodel, updatefieldlist));

            long temp = CommonHelper.ToLong(DBProxy.GetDBHelper(servermodel.DBType).ExecuteSql(connstr, sqlstr));

            if (temp > 0)
            {
                revalue = true;
            }
            return(revalue);
        }
Esempio n. 2
0
        public static bool Delete(SqlBaseItemXml basemodel, long rowid, SqlServerItemXml servermodel, SqlDatabaseItemXml databasemodel, SqlTableItemXml tablemodel, SqlFieldItemXml fieldmodel)
        {
            bool   revalue = false;
            string connstr = GetConnStr(basemodel, servermodel);
            string sqlstr  = string.Format("delete from {0}.dbo.{1} where {2}={3}", databasemodel.DatabaseName, tablemodel.TableName, basemodel.PrimarykeyName, rowid);

            long temp = CommonHelper.ToLong(DBProxy.GetDBHelper(servermodel.DBType).ExecuteSql(connstr, sqlstr));

            if (temp > 0)
            {
                revalue = true;
            }
            return(revalue);
        }