示例#1
0
 public override List <T> Select <T>(Expression <Func <T, bool> > express)
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         SelectOql cs = new SelectOql();
         using (IDataReader idr = OracleSql.GetDtReader(cs.CreateSql <T>(express), oct))
         {
             return(OracleResult.ValueToList <T>(idr));
         }
     }
 }
示例#2
0
 public override int Insert <T>(T t)
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         ics = new InsertOql();
         using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(t), oct))
         {
             return(OracleResult.SingleResult(ocm));
         }
     }
 }
示例#3
0
 //根据主键查询
 public override T Select <T>(object Value)
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         ics = new SelectOql();
         using (IDataReader reader = OracleSql.GetDtReader(ics.CreateSql <T>(Value), oct))
         {
             return(OracleResult.ValueToModel <T>(reader));
         }
     }
 }
示例#4
0
        public override object Select(string sql)
        {
            using (OracleConnection sct = new OracleConnection(Constring))
            {
                sct.Open();

                using (OracleCommand scmd = new OracleCommand(sql, sct))
                {
                    return(OracleResult.returnObject(scmd));
                }
            }
        }
示例#5
0
 /// <summary>
 /// 无参
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public override List <T> Select <T>()
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         ics = new SelectOql();
         using (IDataReader idr = OracleSql.GetDtReader(ics.CreateSql <T>(), oct))
         {
             return(OracleResult.ValueToList <T>(idr));
         }
     }
 }
示例#6
0
 public override int Delete <T>(Expression <Func <T, bool> > express)
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         ics = new DeleteOql();
         using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(express), oct))
         {
             return(OracleResult.SingleResult(ocm));
         }
     }
 }
示例#7
0
 public override int Delete <T>(List <T> t)
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         ics = new DeleteOql();
         using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(t), oct))
         {
             return(OracleResult.ManyResult(ocm));
         }
     }
 }
示例#8
0
 public override int Delete <T>(object Value)
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         ics = new DeleteOql();
         using (OracleCommand ocm = new OracleCommand(ics.CreateSql <T>(Value), oct))
         {
             return(OracleResult.SingleResult(ocm));
         }
     }
 }
示例#9
0
 public override int Update(string sql)
 {
     using (OracleConnection oct = new OracleConnection(Constring))
     {
         oct.Open();
         ics = new UpdateOql();
         using (OracleCommand ocm = new OracleCommand(sql, oct))
         {
             return(OracleResult.SingleResult(ocm));
         }
     }
 }