public static Oeheaderroa BuildOeheaderroaFromRow(DataRow row) { Oeheaderroa entity = new Oeheaderroa(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.takenby = row.IsNull("takenby") ? string.Empty : row.Field <string>("takenby"); entity.mediacd = row.IsNull("mediacd") ? 0 : row.Field <int>("mediacd"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.mediaauth = row.IsNull("mediaauth") ? string.Empty : row.Field <string>("mediaauth"); entity.checkno = row.IsNull("checkno") ? 0 : row.Field <int>("checkno"); entity.bankno = row.IsNull("bankno") ? 0 : row.Field <int>("bankno"); entity.printerfl = row.Field <bool>("printerfl"); entity.creditlimit = row.IsNull("creditlimit") ? decimal.Zero : row.Field <decimal>("creditlimit"); entity.currbal = row.IsNull("currbal") ? decimal.Zero : row.Field <decimal>("currbal"); entity.pastdue = row.IsNull("pastdue") ? decimal.Zero : row.Field <decimal>("pastdue"); entity.misccredits = row.IsNull("misccredits") ? decimal.Zero : row.Field <decimal>("misccredits"); entity.servicecharge = row.IsNull("servicecharge") ? decimal.Zero : row.Field <decimal>("servicecharge"); entity.unappliedcash = row.IsNull("unappliedcash") ? decimal.Zero : row.Field <decimal>("unappliedcash"); entity.totalbal = row.IsNull("totalbal") ? decimal.Zero : row.Field <decimal>("totalbal"); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.cUnMaskCardNo = row.IsNull("cUnMaskCardNo") ? string.Empty : row.Field <string>("cUnMaskCardNo"); entity.cardtype = row.IsNull("cardtype") ? string.Empty : row.Field <string>("cardtype"); entity.referenceno = row.IsNull("referenceno") ? string.Empty : row.Field <string>("referenceno"); entity.shiptoenabledfl = row.Field <bool>("shiptoenabledfl"); entity.shiptolookupenabledfl = row.Field <bool>("shiptolookupenabledfl"); entity.shiptohiddenfl = row.Field <bool>("shiptohiddenfl"); entity.shiptolookuphiddenfl = row.Field <bool>("shiptolookuphiddenfl"); entity.referenabledfl = row.Field <bool>("referenabledfl"); entity.referlookuphiddenfl = row.Field <bool>("referlookuphiddenfl"); entity.referlookupenabledfl = row.Field <bool>("referlookupenabledfl"); entity.banknohiddenfl = row.Field <bool>("banknohiddenfl"); entity.banknoenabledfl = row.Field <bool>("banknoenabledfl"); entity.printernm = row.IsNull("printernm") ? string.Empty : row.Field <string>("printernm"); entity.printerenabledfl = row.Field <bool>("printerenabledfl"); entity.newcardenabledfl = row.Field <bool>("newcardenabledfl"); entity.newcardhiddenfl = row.Field <bool>("newcardhiddenfl"); entity.onetimesalefl = row.Field <bool>("onetimesalefl"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOeheaderroa(ref DataRow row, Oeheaderroa entity) { row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("whse", entity.whse); row.SetField("takenby", entity.takenby); row.SetField("mediacd", entity.mediacd); row.SetField("amount", entity.amount); row.SetField("refer", entity.refer); row.SetField("mediaauth", entity.mediaauth); row.SetField("checkno", entity.checkno); row.SetField("bankno", entity.bankno); row.SetField("printerfl", entity.printerfl); row.SetField("creditlimit", entity.creditlimit); row.SetField("currbal", entity.currbal); row.SetField("pastdue", entity.pastdue); row.SetField("misccredits", entity.misccredits); row.SetField("servicecharge", entity.servicecharge); row.SetField("unappliedcash", entity.unappliedcash); row.SetField("totalbal", entity.totalbal); row.SetField("orderno", entity.orderno); row.SetField("cUnMaskCardNo", entity.cUnMaskCardNo); row.SetField("cardtype", entity.cardtype); row.SetField("referenceno", entity.referenceno); row.SetField("shiptoenabledfl", entity.shiptoenabledfl); row.SetField("shiptolookupenabledfl", entity.shiptolookupenabledfl); row.SetField("shiptohiddenfl", entity.shiptohiddenfl); row.SetField("shiptolookuphiddenfl", entity.shiptolookuphiddenfl); row.SetField("referenabledfl", entity.referenabledfl); row.SetField("referlookuphiddenfl", entity.referlookuphiddenfl); row.SetField("referlookupenabledfl", entity.referlookupenabledfl); row.SetField("banknohiddenfl", entity.banknohiddenfl); row.SetField("banknoenabledfl", entity.banknoenabledfl); row.SetField("printernm", entity.printernm); row.SetField("printerenabledfl", entity.printerenabledfl); row.SetField("newcardenabledfl", entity.newcardenabledfl); row.SetField("newcardhiddenfl", entity.newcardhiddenfl); row.SetField("onetimesalefl", entity.onetimesalefl); row.SetField("userfield", entity.userfield); }