public int DataDelete(FeelingModifyReq req) { int count = 0; using (DbCommand cmd = Db.CreateConnection().CreateCommand()) { string sql = @" DELETE FROM FEELING WHERE SN=@SN; "; cmd.CommandType = CommandType.Text; cmd.CommandText = sql; //Db.AddInParameter(cmd, "SN", DbType.String, req.FEELING.SN); count = Db.ExecuteNonQuery(cmd); } return(count); }
public int DataUpdate(FeelingModifyReq req) { int count = 0; using (DbCommand cmd = Db.CreateConnection().CreateCommand()) { string sql = @" UPDATE FEELING SET WHERE SN=@SN; "; cmd.CommandType = CommandType.Text; cmd.CommandText = sql; count = Db.ExecuteNonQuery(cmd); } return(count); }
public int DataCreate(FeelingModifyReq req) { int count = 0; using (DbCommand cmd = Db.CreateConnection().CreateCommand()) { string sql = @" INSERT FEELING () VALUES () SET @SN = SCOPE_IDENTITY(); "; cmd.CommandType = CommandType.Text; cmd.CommandText = sql; Db.AddOutParameter(cmd, "SN", DbType.Int32, 1); count = Db.ExecuteNonQuery(cmd); //req.FEELING.SN = Db.GetParameterValue(cmd, "SN") as Int32? ?? null; } return(count); }