Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }