public static Pderinitreceiptresults BuildPderinitreceiptresultsFromRow(DataRow row) { Pderinitreceiptresults entity = new Pderinitreceiptresults(); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); entity.claimno = row.IsNull("claimno") ? 0 : row.Field <int>("claimno"); entity.claimseqno = row.IsNull("claimseqno") ? 0 : row.Field <int>("claimseqno"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendname = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname"); entity.vendnotesfl = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl"); entity.divno = row.IsNull("divno") ? 0 : row.Field <int>("divno"); entity.apinvno = row.IsNull("apinvno") ? string.Empty : row.Field <string>("apinvno"); entity.receiptdt = row.Field <DateTime?>("receiptdt"); entity.receiptamt = row.IsNull("receiptamt") ? decimal.Zero : row.Field <decimal>("receiptamt"); entity.sourcepros = row.IsNull("sourcepros") ? string.Empty : row.Field <string>("sourcepros"); entity.srcupdtty = row.IsNull("srcupdtty") ? string.Empty : row.Field <string>("srcupdtty"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.setno = row.IsNull("setno") ? 0 : row.Field <int>("setno"); entity.postdt = row.Field <DateTime?>("postdt"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.currencyty = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty"); entity.vatenabled = row.Field <bool>("vatenabled"); 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 UpdateRowFromPderinitreceiptresults(ref DataRow row, Pderinitreceiptresults entity) { row.SetField("recordtype", entity.recordtype); row.SetField("claimno", entity.claimno); row.SetField("claimseqno", entity.claimseqno); row.SetField("statustype", entity.statustype); row.SetField("vendno", entity.vendno); row.SetField("vendname", entity.vendname); row.SetField("vendnotesfl", entity.vendnotesfl); row.SetField("divno", entity.divno); row.SetField("apinvno", entity.apinvno); row.SetField("receiptdt", entity.receiptdt); row.SetField("receiptamt", entity.receiptamt); row.SetField("sourcepros", entity.sourcepros); row.SetField("srcupdtty", entity.srcupdtty); row.SetField("jrnlno", entity.jrnlno); row.SetField("setno", entity.setno); row.SetField("postdt", entity.postdt); row.SetField("refer", entity.refer); row.SetField("currencyty", entity.currencyty); row.SetField("vatenabled", entity.vatenabled); row.SetField("userfield", entity.userfield); }