public int Insert(SectionRequirementItem item) { string query = "Insert into SectionRequirement(accountId,lectureTypeId,cutline) VALUES(@AccountId,@LectureTypeId, @Cutline)"; IDbParameters param = CreateDbParameters(); param.AddWithValue("AccountId", item.AccountId).DbType = DbType.Int32; param.AddWithValue("LectureTypeId", item.LectureTypeId).DbType = DbType.Int32; param.AddWithValue("Cutline", item.Cutline).DbType = DbType.Int32; return(AdoTemplate.ExecuteNonQuery(CommandType.Text, query, param)); }
public int Update(SectionRequirementItem item) { string query = "UPDATE SectionRequirement SET lectureTypeId = @LectureTypeId, accountId=@AccountId, cutline = @Cutline where id = @Id"; IDbParameters param = CreateDbParameters(); param.AddWithValue("Id", item.Id).DbType = DbType.Int32; param.AddWithValue("LectureTypeId", item.LectureTypeId).DbType = DbType.Int32; param.AddWithValue("AccountId", item.AccountId).DbType = DbType.Int32; param.AddWithValue("Cutline", item.Cutline).DbType = DbType.Int32; return(AdoTemplate.ExecuteNonQuery(CommandType.Text, query, param)); }