/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSasggstvatdata(ref DataRow row, Sasggstvatdata entity) { row.SetField("state", entity.state); row.SetField("descrip", entity.descrip); row.SetField("saletax1", entity.saletax1); row.SetField("saletax2", entity.saletax2); row.SetField("saletax3", entity.saletax3); row.SetField("saletax4", entity.saletax4); row.SetField("saletax5", entity.saletax5); row.SetField("taxid", entity.taxid); row.SetField("pstgstfl", entity.pstgstfl); row.SetField("harmonizedfl", entity.harmonizedfl); row.SetField("ecsalesfl", entity.ecsalesfl); row.SetField("glyear", entity.glyear); row.SetField("acctno", entity.acctno); row.SetField("acctdesc", entity.acctdesc); row.SetField("arcashglno", entity.arcashglno); row.SetField("arcashgldesc", entity.arcashgldesc); row.SetField("taxmethodty", entity.taxmethodty); row.SetField("taxgroup1", entity.taxgroup1); row.SetField("taxgroup2", entity.taxgroup2); row.SetField("taxgroup3", entity.taxgroup3); row.SetField("taxgroup4", entity.taxgroup4); row.SetField("taxgroup5", entity.taxgroup5); row.SetField("saletax1hidden", entity.saletax1hidden); row.SetField("saletax2hidden", entity.saletax2hidden); row.SetField("saletax3hidden", entity.saletax3hidden); row.SetField("saletax4hidden", entity.saletax4hidden); row.SetField("saletax5hidden", entity.saletax5hidden); row.SetField("arcashglnohidden", entity.arcashglnohidden); row.SetField("sasgs-rowid", entity.sasgsRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Sasggstvatdata BuildSasggstvatdataFromRow(DataRow row) { Sasggstvatdata entity = new Sasggstvatdata(); entity.state = row.IsNull("state") ? string.Empty : row.Field <string>("state"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip"); entity.saletax1 = row.IsNull("saletax1") ? decimal.Zero : row.Field <decimal>("saletax1"); entity.saletax2 = row.IsNull("saletax2") ? decimal.Zero : row.Field <decimal>("saletax2"); entity.saletax3 = row.IsNull("saletax3") ? decimal.Zero : row.Field <decimal>("saletax3"); entity.saletax4 = row.IsNull("saletax4") ? decimal.Zero : row.Field <decimal>("saletax4"); entity.saletax5 = row.IsNull("saletax5") ? decimal.Zero : row.Field <decimal>("saletax5"); entity.taxid = row.IsNull("taxid") ? string.Empty : row.Field <string>("taxid"); entity.pstgstfl = row.Field <bool>("pstgstfl"); entity.harmonizedfl = row.Field <bool>("harmonizedfl"); entity.ecsalesfl = row.Field <bool>("ecsalesfl"); entity.glyear = row.IsNull("glyear") ? 0 : row.Field <int>("glyear"); entity.acctno = row.IsNull("acctno") ? string.Empty : row.Field <string>("acctno"); entity.acctdesc = row.IsNull("acctdesc") ? string.Empty : row.Field <string>("acctdesc"); entity.arcashglno = row.IsNull("arcashglno") ? string.Empty : row.Field <string>("arcashglno"); entity.arcashgldesc = row.IsNull("arcashgldesc") ? string.Empty : row.Field <string>("arcashgldesc"); entity.taxmethodty = row.IsNull("taxmethodty") ? string.Empty : row.Field <string>("taxmethodty"); entity.taxgroup1 = row.IsNull("taxgroup1") ? string.Empty : row.Field <string>("taxgroup1"); entity.taxgroup2 = row.IsNull("taxgroup2") ? string.Empty : row.Field <string>("taxgroup2"); entity.taxgroup3 = row.IsNull("taxgroup3") ? string.Empty : row.Field <string>("taxgroup3"); entity.taxgroup4 = row.IsNull("taxgroup4") ? string.Empty : row.Field <string>("taxgroup4"); entity.taxgroup5 = row.IsNull("taxgroup5") ? string.Empty : row.Field <string>("taxgroup5"); entity.saletax1hidden = row.Field <bool>("saletax1hidden"); entity.saletax2hidden = row.Field <bool>("saletax2hidden"); entity.saletax3hidden = row.Field <bool>("saletax3hidden"); entity.saletax4hidden = row.Field <bool>("saletax4hidden"); entity.saletax5hidden = row.Field <bool>("saletax5hidden"); entity.arcashglnohidden = row.Field <bool>("arcashglnohidden"); entity.sasgsRowid = row.Field <byte[]>("sasgs-rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }