示例#1
0
 public int Clear(string tableName = "")
 {
     object[] parms = new object[]
     {
         "@tableName",
         tableName
     };
     return(Convert.ToInt32(DbAdapter1.ExcecuteScalar("spResourceListAuto_Clear", true, parms)));
 }
示例#2
0
        public virtual bool Update(T businessObject)
        {
            string sql = mStoreProcedurePrefix + "AddUpdate";

            businessObject.ID = Extensions.AsLong(DbAdapter1.ExcecuteScalar(sql, true, Take(businessObject)));

            if (businessObject.ID > 0)
            {
                return(true);
            }
            return(false);
        }
        public virtual int UpdateCustomField(object[] parms, string sql)
        {
            switch (ConnectionName)
            {
            case "Default":
                return(Convert.ToInt32(DbAdapter1.ExcecuteScalar(sql, false, parms)));

            case "Inside":
                return(Convert.ToInt32(DbAdapter2.ExcecuteScalar(sql, false, parms)));

            default:
                return(Convert.ToInt32(DbAdapter1.ExcecuteScalar(sql, false, parms)));
            }
        }
        public virtual object GetSingleData(List <string> parms, string storeProcedure)
        {
            switch (ConnectionName)
            {
            case "Default":
                return(DbAdapter1.ExcecuteScalar(storeProcedure, true, parms.ToArray()));

            case "Inside":
                return(DbAdapter2.ExcecuteScalar(storeProcedure, true, parms.ToArray()));

            default:
                return(DbAdapter1.ExcecuteScalar(storeProcedure, true, parms.ToArray()));
            }
        }
示例#5
0
        public virtual int Count()
        {
            string sql = string.Format(@"SELECT count({0}) FROM {1}", mEntityIDName, TableName);

            return(DbAdapter1.ExcecuteScalar(sql, false, null).AsInt());
        }
示例#6
0
 public virtual int UpdateByCustomDataSource(object[] parms, string dataSource)
 {
     return(Convert.ToInt32(DbAdapter1.ExcecuteScalar(dataSource, true, parms)));
 }