/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPolineties(ref DataRow row, Polineties entity) { row.SetField("seqno", entity.seqno); row.SetField("ordertype", entity.ordertype); row.SetField("orderaltno", entity.orderaltno); row.SetField("orderaltsuf", entity.orderaltsuf); row.SetField("linealtno", entity.linealtno); row.SetField("seqaltno", entity.seqaltno); row.SetField("wtcono", entity.wtcono); row.SetField("transtype", entity.transtype); row.SetField("name", entity.name); row.SetField("cleartiefl", entity.cleartiefl); row.SetField("oordertype", entity.oordertype); row.SetField("oorderaltno", entity.oorderaltno); row.SetField("oorderaltsuf", entity.oorderaltsuf); row.SetField("olinealtno", entity.olinealtno); row.SetField("oseqaltno", entity.oseqaltno); row.SetField("owtcono", entity.owtcono); row.SetField("repairordno", entity.repairordno); row.SetField("repairordsuf", entity.repairordsuf); row.SetField("tietype", entity.tietype); row.SetField("modified", entity.modified); row.SetField("tierecid", entity.tierecid); row.SetField("userfield", entity.userfield); }
public static Polineties BuildPolinetiesFromRow(DataRow row) { Polineties entity = new Polineties(); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.ordertype = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype"); entity.orderaltno = row.IsNull("orderaltno") ? 0 : row.Field <int>("orderaltno"); entity.orderaltsuf = row.IsNull("orderaltsuf") ? 0 : row.Field <int>("orderaltsuf"); entity.linealtno = row.IsNull("linealtno") ? 0 : row.Field <int>("linealtno"); entity.seqaltno = row.IsNull("seqaltno") ? 0 : row.Field <int>("seqaltno"); entity.wtcono = row.IsNull("wtcono") ? 0 : row.Field <int>("wtcono"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.name = row.IsNull("name") ? string.Empty : row.Field <string>("name"); entity.cleartiefl = row.Field <bool>("cleartiefl"); entity.oordertype = row.IsNull("oordertype") ? string.Empty : row.Field <string>("oordertype"); entity.oorderaltno = row.IsNull("oorderaltno") ? 0 : row.Field <int>("oorderaltno"); entity.oorderaltsuf = row.IsNull("oorderaltsuf") ? 0 : row.Field <int>("oorderaltsuf"); entity.olinealtno = row.IsNull("olinealtno") ? 0 : row.Field <int>("olinealtno"); entity.oseqaltno = row.IsNull("oseqaltno") ? decimal.Zero : row.Field <decimal>("oseqaltno"); entity.owtcono = row.IsNull("owtcono") ? 0 : row.Field <int>("owtcono"); entity.repairordno = row.IsNull("repairordno") ? 0 : row.Field <int>("repairordno"); entity.repairordsuf = row.IsNull("repairordsuf") ? 0 : row.Field <int>("repairordsuf"); entity.tietype = row.IsNull("tietype") ? string.Empty : row.Field <string>("tietype"); entity.modified = row.Field <bool>("modified"); entity.tierecid = row.IsNull("tierecid") ? 0 : row.Field <long>("tierecid"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }