/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromGetcrossrefresults(ref DataRow row, Getcrossrefresults entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("vendor_id", entity.vendorId); row.SetField("vend_item", entity.vendItem); row.SetField("abs_num", entity.absNum); row.SetField("uom", entity.uom); row.SetField("ref_type", entity.refType); row.SetField("box_qty", entity.boxQty); row.SetField("case_quantity", entity.caseQuantity); row.SetField("pallet_quantity", entity.palletQuantity); row.SetField("stack_height", entity.stackHeight); row.SetField("venddetailrowid", entity.venddetailrowid.ToByteArray()); row.SetField("getcrossrefresultsuserfield", entity.getcrossrefresultsuserfield); row.SetField("userfield", entity.userfield); }
public static Getcrossrefresults BuildGetcrossrefresultsFromRow(DataRow row) { Getcrossrefresults entity = new Getcrossrefresults(); entity.coNum = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num"); entity.whNum = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num"); entity.vendorId = row.IsNull("vendor_id") ? string.Empty : row.Field <string>("vendor_id"); entity.vendItem = row.IsNull("vend_item") ? string.Empty : row.Field <string>("vend_item"); entity.absNum = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num"); entity.uom = row.IsNull("uom") ? string.Empty : row.Field <string>("uom"); entity.refType = row.IsNull("ref_type") ? string.Empty : row.Field <string>("ref_type"); entity.boxQty = row.IsNull("box_qty") ? 0 : row.Field <int>("box_qty"); entity.caseQuantity = row.IsNull("case_quantity") ? decimal.Zero : row.Field <decimal>("case_quantity"); entity.palletQuantity = row.IsNull("pallet_quantity") ? decimal.Zero : row.Field <decimal>("pallet_quantity"); entity.stackHeight = row.IsNull("stack_height") ? 0 : row.Field <int>("stack_height"); entity.venddetailrowid = row.Field <byte[]>("venddetailrowid").ToStringEncoded(); entity.getcrossrefresultsuserfield = row.IsNull("getcrossrefresultsuserfield") ? string.Empty : row.Field <string>("getcrossrefresultsuserfield"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }