/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarlinechange(ref DataRow row, Porrarlinechange entity) { row.SetField("rowid-poeral", entity.rowidPoeral.ToByteArray()); row.SetField("lineno", entity.lineno); row.SetField("seqno", entity.seqno); row.SetField("accepttype", entity.accepttype); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("price", entity.price); row.SetField("rushfl", entity.rushfl); row.SetField("contractno", entity.contractno); row.SetField("priceoverfl", entity.priceoverfl); row.SetField("pdsvcrecno", entity.pdsvcrecno); row.SetField("userfield", entity.userfield); }
public static Porrarlinechange BuildPorrarlinechangeFromRow(DataRow row) { Porrarlinechange entity = new Porrarlinechange(); entity.rowidPoeral = row.Field <byte[]>("rowid-poeral").ToStringEncoded(); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.accepttype = row.IsNull("accepttype") ? string.Empty : row.Field <string>("accepttype"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.rushfl = row.Field <bool>("rushfl"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.priceoverfl = row.Field <bool>("priceoverfl"); entity.pdsvcrecno = row.IsNull("pdsvcrecno") ? 0 : row.Field <int>("pdsvcrecno"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }