예제 #1
0
 /// <summary>
 /// The insert item.
 /// </summary>
 /// <param name="dbCompType"> The database employee entity. </param>
 /// <returns> Returns true if success, false - otherwise </returns>
 public override bool InsertItem(DbCompanyType dbCompType)
 {
     return(this.DbConn.ExecuteInsertQuery(
                this.queriesDict[CrudQueriesEnum.InsertItemQueryTmpl],
                new SqlParameter {
         Value = dbCompType.CompanyTypeName
     }));
 }
예제 #2
0
        /// <summary>
        /// Returns database entity from data row.
        /// </summary>
        /// <param name="row"> The row. </param>
        /// <returns> The <see cref="DbCompany"/>. </returns>
        private static DbCompanyType GetDbEntityFromDataRow(DataRow row)
        {
            var dbCompType = new DbCompanyType();

            dbCompType.CompanyTypeId   = row.Field <int>(dbCompType[0]);
            dbCompType.CompanyTypeName = row.Field <string>(dbCompType[1]);
            return(dbCompType);
        }