示例#1
0
 public bool Update(DataObject Data, WhereStatement Where)
 {
     _WHERE += Where.ToString();
     _Params.AddRange(Where.GetParas());
     try
     {
         StringBuilder SB = new StringBuilder();
         SB.Append("UPDATE ");
         SB.Append(_TableName);
         SB.Append(" SET ");
         foreach (var Item in Data.Keys)
         {
             SB.Append(Item);
             SB.Append(" = ");
             SB.Append("@" + Item);
             SB.Append(",");
         }
         SB.Append(" WHERE ");
         SB.Append(_WHERE);
         string SQL = SB.ToString();
         return(_Helper.ExecuteNonQuery(SQL, _Params.ToArray()));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
示例#2
0
 public bool Delete(WhereStatement Where)
 {
     _WHERE += Where.ToString();
     _Params.AddRange(Where.GetParas());
     try
     {
         StringBuilder SB = new StringBuilder();
         SB.Append("UPDATE ");
         SB.Append(_TableName);
         SB.Append(" SET [status] = -1");
         SB.Append(" WHERE ");
         SB.Append(_WHERE);
         string SQL = SB.ToString();
         return(_Helper.ExecuteNonQuery(SQL, _Params.ToArray()));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
示例#3
0
 public L2Database Where(WhereStatement WhereStatement)
 {
     _WHERE += WhereStatement.ToString();
     _Params.AddRange(WhereStatement.GetParas());
     return(this);
 }