/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarlinedsplline(ref DataRow row, Porrarlinedsplline entity) { row.SetField("accepttype", entity.accepttype); row.SetField("tiehold", entity.tiehold); row.SetField("specnstype", entity.specnstype); row.SetField("commentfl", entity.commentfl); row.SetField("shipprod", entity.shipprod); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("notesfl", entity.notesfl); row.SetField("price", entity.price); row.SetField("rushfl", entity.rushfl); row.SetField("belowopfl", entity.belowopfl); row.SetField("lock", entity.@lock); row.SetField("criticalfl", entity.criticalfl); row.SetField("npnafl", entity.npnafl); row.SetField("ordertype", entity.ordertype); row.SetField("lineno", entity.lineno); row.SetField("seqno", entity.seqno); row.SetField("addlcarrycost", entity.addlcarrycost); row.SetField("blno", entity.blno); row.SetField("blsuf", entity.blsuf); row.SetField("descrip", entity.descrip); row.SetField("qtybreak", entity.qtybreak); row.SetField("orderaltno", entity.orderaltno); row.SetField("orderaltsuf", entity.orderaltsuf); row.SetField("linealtno", entity.linealtno); row.SetField("seqaltno", entity.seqaltno); row.SetField("promisedt", entity.promisedt); row.SetField("companyrank", entity.companyrank); row.SetField("whserank", entity.whserank); row.SetField("contractno", entity.contractno); row.SetField("pdsvcrecno", entity.pdsvcrecno); row.SetField("vendquote", entity.vendquote); row.SetField("abcrankty", entity.abcrankty); row.SetField("srcriticalfl", entity.srcriticalfl); row.SetField("custonhand", entity.custonhand); row.SetField("superty", entity.superty); row.SetField("unitbuy", entity.unitbuy); row.SetField("unitstnd", entity.unitstnd); row.SetField("custname", entity.custname); row.SetField("custnumber", entity.custnumber); row.SetField("takenby", entity.takenby); row.SetField("updtype", entity.updtype); row.SetField("netavail", entity.netavail); 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("vendprod", entity.vendprod); row.SetField("reportno", entity.reportno); row.SetField("rowid-poeral", entity.rowidPoeral.ToByteArray()); row.SetField("custreserveqty", entity.custreserveqty); row.SetField("custreservefoundfl", entity.custreservefoundfl); row.SetField("custforecastqty", entity.custforecastqty); row.SetField("custforecastfoundfl", entity.custforecastfoundfl); row.SetField("msdsfl", entity.msdsfl); row.SetField("surplus", entity.surplus); row.SetField("usagerate", entity.usagerate); row.SetField("upcid", entity.upcid); row.SetField("userfield", entity.userfield); }
public static Porrarlinedsplline BuildPorrarlinedspllineFromRow(DataRow row) { Porrarlinedsplline entity = new Porrarlinedsplline(); entity.accepttype = row.IsNull("accepttype") ? string.Empty : row.Field <string>("accepttype"); entity.tiehold = row.IsNull("tiehold") ? string.Empty : row.Field <string>("tiehold"); entity.specnstype = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype"); entity.commentfl = row.Field <bool>("commentfl"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.rushfl = row.Field <bool>("rushfl"); entity.belowopfl = row.Field <bool>("belowopfl"); entity.@lock = row.IsNull("lock") ? string.Empty : row.Field <string>("lock"); entity.criticalfl = row.Field <bool>("criticalfl"); entity.npnafl = row.Field <bool>("npnafl"); entity.ordertype = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.addlcarrycost = row.IsNull("addlcarrycost") ? decimal.Zero : row.Field <decimal>("addlcarrycost"); entity.blno = row.IsNull("blno") ? 0 : row.Field <int>("blno"); entity.blsuf = row.IsNull("blsuf") ? 0 : row.Field <int>("blsuf"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip"); entity.qtybreak = row.IsNull("qtybreak") ? string.Empty : row.Field <string>("qtybreak"); entity.orderaltno = row.IsNull("orderaltno") ? 0 : row.Field <int>("orderaltno"); entity.orderaltsuf = row.IsNull("orderaltsuf") ? 0 : row.Field <int>("orderaltsuf"); entity.linealtno = row.IsNull("linealtno") ? 0 : row.Field <int>("linealtno"); entity.seqaltno = row.IsNull("seqaltno") ? 0 : row.Field <int>("seqaltno"); entity.promisedt = row.Field <DateTime?>("promisedt"); entity.companyrank = row.IsNull("companyrank") ? string.Empty : row.Field <string>("companyrank"); entity.whserank = row.IsNull("whserank") ? string.Empty : row.Field <string>("whserank"); entity.contractno = row.IsNull("contractno") ? string.Empty : row.Field <string>("contractno"); entity.pdsvcrecno = row.IsNull("pdsvcrecno") ? 0 : row.Field <int>("pdsvcrecno"); entity.vendquote = row.IsNull("vendquote") ? string.Empty : row.Field <string>("vendquote"); entity.abcrankty = row.IsNull("abcrankty") ? string.Empty : row.Field <string>("abcrankty"); entity.srcriticalfl = row.IsNull("srcriticalfl") ? string.Empty : row.Field <string>("srcriticalfl"); entity.custonhand = row.IsNull("custonhand") ? decimal.Zero : row.Field <decimal>("custonhand"); entity.superty = row.IsNull("superty") ? string.Empty : row.Field <string>("superty"); entity.unitbuy = row.IsNull("unitbuy") ? string.Empty : row.Field <string>("unitbuy"); entity.unitstnd = row.IsNull("unitstnd") ? string.Empty : row.Field <string>("unitstnd"); entity.custname = row.IsNull("custname") ? string.Empty : row.Field <string>("custname"); entity.custnumber = row.IsNull("custnumber") ? decimal.Zero : row.Field <decimal>("custnumber"); entity.takenby = row.IsNull("takenby") ? string.Empty : row.Field <string>("takenby"); entity.updtype = row.IsNull("updtype") ? string.Empty : row.Field <string>("updtype"); entity.netavail = row.IsNull("netavail") ? decimal.Zero : row.Field <decimal>("netavail"); 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.vendprod = row.IsNull("vendprod") ? string.Empty : row.Field <string>("vendprod"); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); entity.rowidPoeral = row.Field <byte[]>("rowid-poeral").ToStringEncoded(); entity.custreserveqty = row.IsNull("custreserveqty") ? decimal.Zero : row.Field <decimal>("custreserveqty"); entity.custreservefoundfl = row.Field <bool>("custreservefoundfl"); entity.custforecastqty = row.IsNull("custforecastqty") ? decimal.Zero : row.Field <decimal>("custforecastqty"); entity.custforecastfoundfl = row.Field <bool>("custforecastfoundfl"); entity.msdsfl = row.Field <bool>("msdsfl"); entity.surplus = row.Field <bool>("surplus"); entity.usagerate = row.IsNull("usagerate") ? decimal.Zero : row.Field <decimal>("usagerate"); entity.upcid = row.IsNull("upcid") ? string.Empty : row.Field <string>("upcid"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); foreach (var dRow in row.GetChildRows("C_Surplus")) { Porrarlinedspllinesur porrarlinedspllinesur = new Porrarlinedspllinesur(); porrarlinedspllinesur = (Porrarlinedspllinesur)SetKeyFields(entity, Porrarlinedspllinesur.BuildPorrarlinedspllinesurFromRow(dRow), "reportno,lineno", "reportno,lineno"); entity.porrarlinedspllinesur.Add(porrarlinedspllinesur); } return(entity); }