Beispiel #1
0
        public int Update(EducationTypeModel model)
        {
            string sqlUpdate = "UPDATE EducationType SET Name = @Name WHERE Id = @Id";

            using (_connection)
            {
                return(_connection.Execute(sqlUpdate, model));
            }
        }
Beispiel #2
0
        public int Insert(EducationTypeModel model)
        {
            string sqlInsert = "INSERT INTO EducationType (Id, Name) Values (@Id, @Name)";

            using (_connection)
            {
                return(_connection.Execute(sqlInsert, model));
            }
        }
Beispiel #3
0
        public int Delete(EducationTypeModel model)
        {
            string sqlDelete = "DELETE FROM EducationType WHERE Id = @Id";

            using (_connection)
            {
                return(_connection.Execute(sqlDelete, model));
            }
        }
Beispiel #4
0
 /// <summary>
 /// Method whose purpose is to insert a new
 /// EducationType record.
 /// </summary>
 /// <param name="educationType">
 /// Newly created EducationTypeModel object.
 /// </param>
 /// <returns>
 /// Returns true if the query is successfully executed
 /// otherwise returns false.
 /// </returns>
 public bool Insert(EducationTypeModel educationType)
 {
     return(_educationTypeRepository.Insert(educationType) > 0 ? true : false);
 }
Beispiel #5
0
 /// <summary>
 /// Method whose purpose is to delete existing object
 /// from the database
 /// </summary>
 /// <param name="educationType">
 /// Existing education type model object.
 /// </param>
 /// <returns>
 /// Returns true if the query is successfully executed
 /// otherwise returns false.
 /// </returns>
 public bool Delete(EducationTypeModel educationType)
 {
     return(_educationTypeRepository.Delete(educationType) > 0 ? true : false);
 }