public static Loadpolinedetailresults BuildLoadpolinedetailresultsFromRow(DataRow row) { Loadpolinedetailresults entity = new Loadpolinedetailresults(); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.nonstockty = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.cNotes = row.IsNull("cNotes") ? string.Empty : row.Field <string>("cNotes"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.commentfl = row.Field <bool>("commentfl"); entity.dQtyOrdered = row.IsNull("dQtyOrdered") ? decimal.Zero : row.Field <decimal>("dQtyOrdered"); entity.duedt = row.Field <DateTime?>("duedt"); entity.netamt = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt"); entity.cPrice = row.IsNull("cPrice") ? string.Empty : row.Field <string>("cPrice"); entity.cQtyRcv = row.IsNull("cQtyRcv") ? string.Empty : row.Field <string>("cQtyRcv"); entity.cRcvCost = row.IsNull("cRcvCost") ? string.Empty : row.Field <string>("cRcvCost"); entity.cQtyCosted = row.IsNull("cQtyCosted") ? string.Empty : row.Field <string>("cQtyCosted"); entity.cInvCost = row.IsNull("cInvCost") ? string.Empty : row.Field <string>("cInvCost"); entity.cSpeccostdsply = row.IsNull("cSpeccostdsply") ? string.Empty : row.Field <string>("cSpeccostdsply"); entity.cNetAmt = row.IsNull("cNetAmt") ? string.Empty : row.Field <string>("cNetAmt"); entity.cProdDesc = row.IsNull("cProdDesc") ? string.Empty : row.Field <string>("cProdDesc"); entity.lCancel = row.Field <bool>("lCancel"); entity.trackno = row.IsNull("trackno") ? 0 : row.Field <int>("trackno"); entity.tracklineno = row.IsNull("tracklineno") ? 0 : row.Field <int>("tracklineno"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.pdsvcrecno = row.IsNull("pdsvcrecno") ? 0 : row.Field <int>("pdsvcrecno"); entity.lRecvaddfl = row.Field <bool>("lRecvaddfl"); entity.lCorrectionFl = row.Field <bool>("lCorrectionFl"); entity.cVendorProduct = row.IsNull("cVendorProduct") ? string.Empty : row.Field <string>("cVendorProduct"); entity.cVendQuote = row.IsNull("cVendQuote") ? string.Empty : row.Field <string>("cVendQuote"); entity.ackdt = row.Field <DateTime?>("ackdt"); entity.ackrsn = row.IsNull("ackrsn") ? string.Empty : row.Field <string>("ackrsn"); entity.mnonstock = row.Field <bool>("mnonstock"); entity.mties = row.Field <bool>("mties"); entity.mseriallot = row.Field <bool>("mseriallot"); entity.mtally = row.Field <bool>("mtally"); entity.maddons = row.Field <bool>("maddons"); entity.mcostingactivity = row.Field <bool>("mcostingactivity"); entity.mreturnallocation = row.Field <bool>("mreturnallocation"); entity.ncnr = row.IsNull("ncnr") ? string.Empty : row.Field <string>("ncnr"); entity.countryoforigin = row.IsNull("countryoforigin") ? string.Empty : row.Field <string>("countryoforigin"); entity.tariffcd = row.IsNull("tariffcd") ? string.Empty : row.Field <string>("tariffcd"); entity.dutyrate = row.IsNull("dutyrate") ? decimal.Zero : row.Field <decimal>("dutyrate"); entity.brandcode = row.IsNull("brandcode") ? string.Empty : row.Field <string>("brandcode"); entity.mfgprod = row.IsNull("mfgprod") ? string.Empty : row.Field <string>("mfgprod"); entity.msdsfl = row.Field <bool>("msdsfl"); entity.vendretauth = row.IsNull("vendretauth") ? string.Empty : row.Field <string>("vendretauth"); entity.upcid = row.IsNull("upcid") ? string.Empty : row.Field <string>("upcid"); 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 UpdateRowFromLoadpolinedetailresults(ref DataRow row, Loadpolinedetailresults entity) { row.SetField("lineno", entity.lineno); row.SetField("nonstockty", entity.nonstockty); row.SetField("shipprod", entity.shipprod); row.SetField("cNotes", entity.cNotes); row.SetField("unit", entity.unit); row.SetField("commentfl", entity.commentfl); row.SetField("dQtyOrdered", entity.dQtyOrdered); row.SetField("duedt", entity.duedt); row.SetField("netamt", entity.netamt); row.SetField("cPrice", entity.cPrice); row.SetField("cQtyRcv", entity.cQtyRcv); row.SetField("cRcvCost", entity.cRcvCost); row.SetField("cQtyCosted", entity.cQtyCosted); row.SetField("cInvCost", entity.cInvCost); row.SetField("cSpeccostdsply", entity.cSpeccostdsply); row.SetField("cNetAmt", entity.cNetAmt); row.SetField("cProdDesc", entity.cProdDesc); row.SetField("lCancel", entity.lCancel); row.SetField("trackno", entity.trackno); row.SetField("tracklineno", entity.tracklineno); row.SetField("contractno", entity.contractno); row.SetField("pdsvcrecno", entity.pdsvcrecno); row.SetField("lRecvaddfl", entity.lRecvaddfl); row.SetField("lCorrectionFl", entity.lCorrectionFl); row.SetField("cVendorProduct", entity.cVendorProduct); row.SetField("cVendQuote", entity.cVendQuote); row.SetField("ackdt", entity.ackdt); row.SetField("ackrsn", entity.ackrsn); row.SetField("mnonstock", entity.mnonstock); row.SetField("mties", entity.mties); row.SetField("mseriallot", entity.mseriallot); row.SetField("mtally", entity.mtally); row.SetField("maddons", entity.maddons); row.SetField("mcostingactivity", entity.mcostingactivity); row.SetField("mreturnallocation", entity.mreturnallocation); row.SetField("ncnr", entity.ncnr); row.SetField("countryoforigin", entity.countryoforigin); row.SetField("tariffcd", entity.tariffcd); row.SetField("dutyrate", entity.dutyrate); row.SetField("brandcode", entity.brandcode); row.SetField("mfgprod", entity.mfgprod); row.SetField("msdsfl", entity.msdsfl); row.SetField("vendretauth", entity.vendretauth); row.SetField("upcid", entity.upcid); row.SetField("userfield", entity.userfield); }