/// <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 })); }
/// <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); }