public static Iceamdetail BuildIceamdetailFromRow(DataRow row) { Iceamdetail entity = new Iceamdetail(); entity.transty = row.IsNull("transty") ? string.Empty : row.Field <string>("transty"); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.coreprod = row.IsNull("coreprod") ? string.Empty : row.Field <string>("coreprod"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.implyprod = row.IsNull("implyprod") ? string.Empty : row.Field <string>("implyprod"); entity.origprod = row.IsNull("origprod") ? string.Empty : row.Field <string>("origprod"); entity.qty = row.IsNull("qty") ? decimal.Zero : row.Field <decimal>("qty"); entity.qtyalloc = row.IsNull("qtyalloc") ? decimal.Zero : row.Field <decimal>("qtyalloc"); entity.qtybank = row.IsNull("qtybank") ? decimal.Zero : row.Field <decimal>("qtybank"); entity.qtywarr = row.IsNull("qtywarr") ? decimal.Zero : row.Field <decimal>("qtywarr"); entity.statusfl = row.Field <bool>("statusfl"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.manadjfl = row.Field <bool>("manadjfl"); entity.manoper = row.IsNull("manoper") ? string.Empty : row.Field <string>("manoper"); entity.mandt = row.Field <DateTime?>("mandt"); entity.mantm = row.IsNull("mantm") ? string.Empty : row.Field <string>("mantm"); entity.ordernotesfl = row.IsNull("ordernotesfl") ? string.Empty : row.Field <string>("ordernotesfl"); entity.orderrowid = row.Field <byte[]>("orderrowid").ToStringEncoded(); entity.arscnotesfl = row.IsNull("arscnotesfl") ? string.Empty : row.Field <string>("arscnotesfl"); entity.arscrowid = row.Field <byte[]>("arscrowid").ToStringEncoded(); entity.apsvnotesfl = row.IsNull("apsvnotesfl") ? string.Empty : row.Field <string>("apsvnotesfl"); entity.apsvrowid = row.Field <byte[]>("apsvrowid").ToStringEncoded(); entity.icspnotesfl = row.IsNull("icspnotesfl") ? string.Empty : row.Field <string>("icspnotesfl"); entity.icsprowid = row.Field <byte[]>("icsprowid").ToStringEncoded(); entity.iceamRecid = row.IsNull("iceam-recid") ? 0 : row.Field <long>("iceam-recid"); entity.returncd = row.IsNull("returncd") ? string.Empty : row.Field <string>("returncd"); entity.iceamrowid = row.Field <byte[]>("iceamrowid").ToStringEncoded(); entity.implyprodqty = row.IsNull("implyprodqty") ? 0 : row.Field <int>("implyprodqty"); entity.repairordno = row.IsNull("repairordno") ? 0 : row.Field <int>("repairordno"); entity.repairordsuf = row.IsNull("repairordsuf") ? 0 : row.Field <int>("repairordsuf"); entity.repairlineno = row.IsNull("repairlineno") ? 0 : row.Field <int>("repairlineno"); entity.corechg = row.IsNull("corechg") ? decimal.Zero : row.Field <decimal>("corechg"); entity.coreduedt = row.Field <DateTime?>("coreduedt"); entity.corevalue = row.IsNull("corevalue") ? decimal.Zero : row.Field <decimal>("corevalue"); entity.intclaimno = row.IsNull("intclaimno") ? 0 : row.Field <int>("intclaimno"); entity.invoicedt = row.Field <DateTime?>("invoicedt"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.implyqty = row.IsNull("implyqty") ? 0 : row.Field <int>("implyqty"); entity.pfpfl = row.Field <bool>("pfpfl"); entity.mode = row.IsNull("mode") ? string.Empty : row.Field <string>("mode"); 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 UpdateRowFromIceamdetail(ref DataRow row, Iceamdetail entity) { row.SetField("transty", entity.transty); row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("lineno", entity.lineno); row.SetField("seqno", entity.seqno); row.SetField("coreprod", entity.coreprod); row.SetField("custno", entity.custno); row.SetField("implyprod", entity.implyprod); row.SetField("origprod", entity.origprod); row.SetField("qty", entity.qty); row.SetField("qtyalloc", entity.qtyalloc); row.SetField("qtybank", entity.qtybank); row.SetField("qtywarr", entity.qtywarr); row.SetField("statusfl", entity.statusfl); row.SetField("vendno", entity.vendno); row.SetField("whse", entity.whse); row.SetField("manadjfl", entity.manadjfl); row.SetField("manoper", entity.manoper); row.SetField("mandt", entity.mandt); row.SetField("mantm", entity.mantm); row.SetField("ordernotesfl", entity.ordernotesfl); row.SetField("orderrowid", entity.orderrowid.ToByteArray()); row.SetField("arscnotesfl", entity.arscnotesfl); row.SetField("arscrowid", entity.arscrowid.ToByteArray()); row.SetField("apsvnotesfl", entity.apsvnotesfl); row.SetField("apsvrowid", entity.apsvrowid.ToByteArray()); row.SetField("icspnotesfl", entity.icspnotesfl); row.SetField("icsprowid", entity.icsprowid.ToByteArray()); row.SetField("iceam-recid", entity.iceamRecid); row.SetField("returncd", entity.returncd); row.SetField("iceamrowid", entity.iceamrowid.ToByteArray()); row.SetField("implyprodqty", entity.implyprodqty); row.SetField("repairordno", entity.repairordno); row.SetField("repairordsuf", entity.repairordsuf); row.SetField("repairlineno", entity.repairlineno); row.SetField("corechg", entity.corechg); row.SetField("coreduedt", entity.coreduedt); row.SetField("corevalue", entity.corevalue); row.SetField("intclaimno", entity.intclaimno); row.SetField("invoicedt", entity.invoicedt); row.SetField("price", entity.price); row.SetField("implyqty", entity.implyqty); row.SetField("pfpfl", entity.pfpfl); row.SetField("mode", entity.mode); row.SetField("userfield", entity.userfield); }