/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdinheaderresults(ref DataRow row, Pdinheaderresults entity) { row.SetField("vendno", entity.vendno); row.SetField("orderno", entity.orderno); row.SetField("claimno", entity.claimno); row.SetField("seqno", entity.seqno); row.SetField("statusty", entity.statusty); row.SetField("invdt", entity.invdt); row.SetField("paiddt", entity.paiddt); row.SetField("totclmAmt", entity.totclmAmt); row.SetField("totpaidAmt", entity.totpaidAmt); row.SetField("varamt", entity.varamt); row.SetField("varpct", entity.varpct); row.SetField("tolexpfl", entity.tolexpfl); row.SetField("tolexpflv", entity.tolexpflv); row.SetField("origordno", entity.origordno); row.SetField("origcustno", entity.origcustno); row.SetField("origShipto", entity.origShipto); row.SetField("origcustomer", entity.origcustomer); row.SetField("oepsttax", entity.oepsttax); row.SetField("oegsttax", entity.oegsttax); row.SetField("oeaddonamt", entity.oeaddonamt); row.SetField("pdpsttax", entity.pdpsttax); row.SetField("pdgsttax", entity.pdgsttax); row.SetField("pdaddonamt", entity.pdaddonamt); row.SetField("invjrnlno", entity.invjrnlno); row.SetField("paidjrnlno", entity.paidjrnlno); row.SetField("paidjrnlty", entity.paidjrnlty); row.SetField("invchkno", entity.invchkno); row.SetField("userfield", entity.userfield); }
public static Pdinheaderresults BuildPdinheaderresultsFromRow(DataRow row) { Pdinheaderresults entity = new Pdinheaderresults(); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.orderno = row.IsNull("orderno") ? string.Empty : row.Field <string>("orderno"); entity.claimno = row.IsNull("claimno") ? string.Empty : row.Field <string>("claimno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.statusty = row.IsNull("statusty") ? string.Empty : row.Field <string>("statusty"); entity.invdt = row.Field <DateTime?>("invdt"); entity.paiddt = row.Field <DateTime?>("paiddt"); entity.totclmAmt = row.IsNull("totclmAmt") ? decimal.Zero : row.Field <decimal>("totclmAmt"); entity.totpaidAmt = row.IsNull("totpaidAmt") ? decimal.Zero : row.Field <decimal>("totpaidAmt"); entity.varamt = row.IsNull("varamt") ? decimal.Zero : row.Field <decimal>("varamt"); entity.varpct = row.IsNull("varpct") ? decimal.Zero : row.Field <decimal>("varpct"); entity.tolexpfl = row.Field <bool>("tolexpfl"); entity.tolexpflv = row.Field <bool>("tolexpflv"); entity.origordno = row.IsNull("origordno") ? string.Empty : row.Field <string>("origordno"); entity.origcustno = row.IsNull("origcustno") ? decimal.Zero : row.Field <decimal>("origcustno"); entity.origShipto = row.IsNull("origShipto") ? string.Empty : row.Field <string>("origShipto"); entity.origcustomer = row.IsNull("origcustomer") ? string.Empty : row.Field <string>("origcustomer"); entity.oepsttax = row.IsNull("oepsttax") ? decimal.Zero : row.Field <decimal>("oepsttax"); entity.oegsttax = row.IsNull("oegsttax") ? decimal.Zero : row.Field <decimal>("oegsttax"); entity.oeaddonamt = row.IsNull("oeaddonamt") ? decimal.Zero : row.Field <decimal>("oeaddonamt"); entity.pdpsttax = row.IsNull("pdpsttax") ? decimal.Zero : row.Field <decimal>("pdpsttax"); entity.pdgsttax = row.IsNull("pdgsttax") ? decimal.Zero : row.Field <decimal>("pdgsttax"); entity.pdaddonamt = row.IsNull("pdaddonamt") ? decimal.Zero : row.Field <decimal>("pdaddonamt"); entity.invjrnlno = row.IsNull("invjrnlno") ? 0 : row.Field <int>("invjrnlno"); entity.paidjrnlno = row.IsNull("paidjrnlno") ? 0 : row.Field <int>("paidjrnlno"); entity.paidjrnlty = row.IsNull("paidjrnlty") ? string.Empty : row.Field <string>("paidjrnlty"); entity.invchkno = row.IsNull("invchkno") ? string.Empty : row.Field <string>("invchkno"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }