public static Icipfetchbalresults BuildIcipfetchbalresultsFromRow(DataRow row) { Icipfetchbalresults entity = new Icipfetchbalresults(); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.cdesc = row.IsNull("cdesc") ? string.Empty : row.Field <string>("cdesc"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.averagecst = row.IsNull("averagecst") ? decimal.Zero : row.Field <decimal>("averagecst"); entity.costsdesc = row.IsNull("costsdesc") ? string.Empty : row.Field <string>("costsdesc"); entity.onhand = row.IsNull("onhand") ? decimal.Zero : row.Field <decimal>("onhand"); entity.qtydesc = row.IsNull("qtydesc") ? string.Empty : row.Field <string>("qtydesc"); entity.lastcst = row.IsNull("lastcst") ? decimal.Zero : row.Field <decimal>("lastcst"); entity.costsdesc2 = row.IsNull("costsdesc2") ? string.Empty : row.Field <string>("costsdesc2"); entity.qtydesc2 = row.IsNull("qtydesc2") ? string.Empty : row.Field <string>("qtydesc2"); entity.reserved = row.IsNull("reserved") ? decimal.Zero : row.Field <decimal>("reserved"); entity.replacementcst = row.IsNull("replacementcst") ? decimal.Zero : row.Field <decimal>("replacementcst"); entity.replacementchgdt = row.Field <DateTime?>("replacementchgdt"); entity.committed = row.IsNull("committed") ? decimal.Zero : row.Field <decimal>("committed"); entity.standardcst = row.IsNull("standardcst") ? decimal.Zero : row.Field <decimal>("standardcst"); entity.standardchgdt = row.Field <DateTime?>("standardchgdt"); entity.netavail = row.IsNull("netavail") ? decimal.Zero : row.Field <decimal>("netavail"); entity.rebatecst = row.IsNull("rebatecst") ? decimal.Zero : row.Field <decimal>("rebatecst"); entity.backorder = row.IsNull("backorder") ? decimal.Zero : row.Field <decimal>("backorder"); entity.addoncst = row.IsNull("addoncst") ? decimal.Zero : row.Field <decimal>("addoncst"); entity.onorder = row.IsNull("onorder") ? decimal.Zero : row.Field <decimal>("onorder"); entity.datccst = row.IsNull("datccst") ? decimal.Zero : row.Field <decimal>("datccst"); entity.received = row.IsNull("received") ? decimal.Zero : row.Field <decimal>("received"); entity.lifobasecst = row.IsNull("lifobasecst") ? decimal.Zero : row.Field <decimal>("lifobasecst"); entity.unavail = row.IsNull("unavail") ? decimal.Zero : row.Field <decimal>("unavail"); entity.lastforeigncst = row.IsNull("lastforeigncst") ? decimal.Zero : row.Field <decimal>("lastforeigncst"); entity.wtintrans = row.IsNull("wtintrans") ? decimal.Zero : row.Field <decimal>("wtintrans"); entity.glbydesc = row.IsNull("glbydesc") ? string.Empty : row.Field <string>("glbydesc"); entity.wtshipreq = row.IsNull("wtshipreq") ? decimal.Zero : row.Field <decimal>("wtshipreq"); entity.costbydesc = row.IsNull("costbydesc") ? string.Empty : row.Field <string>("costbydesc"); entity.wtrcvreq = row.IsNull("wtrcvreq") ? decimal.Zero : row.Field <decimal>("wtrcvreq"); entity.demand = row.IsNull("demand") ? decimal.Zero : row.Field <decimal>("demand"); entity.custaveragecst = row.IsNull("custaveragecst") ? decimal.Zero : row.Field <decimal>("custaveragecst"); entity.custonhand = row.IsNull("custonhand") ? decimal.Zero : row.Field <decimal>("custonhand"); entity.custlastcst = row.IsNull("custlastcst") ? decimal.Zero : row.Field <decimal>("custlastcst"); entity.custonorder = row.IsNull("custonorder") ? decimal.Zero : row.Field <decimal>("custonorder"); entity.custfixedcst = row.IsNull("custfixedcst") ? decimal.Zero : row.Field <decimal>("custfixedcst"); entity.custunavail = row.IsNull("custunavail") ? decimal.Zero : row.Field <decimal>("custunavail"); entity.custqtyrcvd = row.IsNull("custqtyrcvd") ? decimal.Zero : row.Field <decimal>("custqtyrcvd"); entity.descrip3 = row.IsNull("descrip3") ? string.Empty : row.Field <string>("descrip3"); entity.datccstlbl = row.IsNull("datccstlbl") ? string.Empty : row.Field <string>("datccstlbl"); entity.managedwhsefl = row.Field <bool>("managedwhsefl"); 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 UpdateRowFromIcipfetchbalresults(ref DataRow row, Icipfetchbalresults entity) { row.SetField("prod", entity.prod); row.SetField("cdesc", entity.cdesc); row.SetField("whse", entity.whse); row.SetField("averagecst", entity.averagecst); row.SetField("costsdesc", entity.costsdesc); row.SetField("onhand", entity.onhand); row.SetField("qtydesc", entity.qtydesc); row.SetField("lastcst", entity.lastcst); row.SetField("costsdesc2", entity.costsdesc2); row.SetField("qtydesc2", entity.qtydesc2); row.SetField("reserved", entity.reserved); row.SetField("replacementcst", entity.replacementcst); row.SetField("replacementchgdt", entity.replacementchgdt); row.SetField("committed", entity.committed); row.SetField("standardcst", entity.standardcst); row.SetField("standardchgdt", entity.standardchgdt); row.SetField("netavail", entity.netavail); row.SetField("rebatecst", entity.rebatecst); row.SetField("backorder", entity.backorder); row.SetField("addoncst", entity.addoncst); row.SetField("onorder", entity.onorder); row.SetField("datccst", entity.datccst); row.SetField("received", entity.received); row.SetField("lifobasecst", entity.lifobasecst); row.SetField("unavail", entity.unavail); row.SetField("lastforeigncst", entity.lastforeigncst); row.SetField("wtintrans", entity.wtintrans); row.SetField("glbydesc", entity.glbydesc); row.SetField("wtshipreq", entity.wtshipreq); row.SetField("costbydesc", entity.costbydesc); row.SetField("wtrcvreq", entity.wtrcvreq); row.SetField("demand", entity.demand); row.SetField("custaveragecst", entity.custaveragecst); row.SetField("custonhand", entity.custonhand); row.SetField("custlastcst", entity.custlastcst); row.SetField("custonorder", entity.custonorder); row.SetField("custfixedcst", entity.custfixedcst); row.SetField("custunavail", entity.custunavail); row.SetField("custqtyrcvd", entity.custqtyrcvd); row.SetField("descrip3", entity.descrip3); row.SetField("datccstlbl", entity.datccstlbl); row.SetField("managedwhsefl", entity.managedwhsefl); row.SetField("userfield", entity.userfield); }