/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWtrrarlinedspllinesur(ref DataRow row, Wtrrarlinedspllinesur entity) { row.SetField("accepttype", entity.accepttype); row.SetField("specnstype", entity.specnstype); row.SetField("commentfl", entity.commentfl); row.SetField("notesfl", entity.notesfl); row.SetField("shipprod", entity.shipprod); row.SetField("descrip", entity.descrip); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("prodcost", entity.prodcost); row.SetField("rushfl", entity.rushfl); row.SetField("lineno", entity.lineno); row.SetField("seqno", entity.seqno); row.SetField("criticalfl", entity.criticalfl); row.SetField("superfl", entity.superfl); row.SetField("linewhse", entity.linewhse); row.SetField("reportno", entity.reportno); row.SetField("brandcode", entity.brandcode); row.SetField("mfgprod", entity.mfgprod); row.SetField("vendprod", entity.vendprod); row.SetField("msdsfl", entity.msdsfl); row.SetField("origaccepttype", entity.origaccepttype); row.SetField("origqtyord", entity.origqtyord); row.SetField("rowid-wteral", entity.rowidWteral.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Wtrrarlinedspllinesur BuildWtrrarlinedspllinesurFromRow(DataRow row) { Wtrrarlinedspllinesur entity = new Wtrrarlinedspllinesur(); entity.accepttype = row.IsNull("accepttype") ? string.Empty : row.Field <string>("accepttype"); entity.specnstype = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype"); entity.commentfl = row.Field <bool>("commentfl"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.rushfl = row.Field <bool>("rushfl"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.criticalfl = row.Field <bool>("criticalfl"); entity.superfl = row.Field <bool>("superfl"); entity.linewhse = row.IsNull("linewhse") ? string.Empty : row.Field <string>("linewhse"); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); 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.msdsfl = row.Field <bool>("msdsfl"); entity.origaccepttype = row.IsNull("origaccepttype") ? string.Empty : row.Field <string>("origaccepttype"); entity.origqtyord = row.IsNull("origqtyord") ? decimal.Zero : row.Field <decimal>("origqtyord"); entity.rowidWteral = row.Field <byte[]>("rowid-wteral").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
public static Wtrrarlinedsplline BuildWtrrarlinedspllineFromRow(DataRow row) { Wtrrarlinedsplline entity = new Wtrrarlinedsplline(); entity.accepttype = row.IsNull("accepttype") ? string.Empty : row.Field <string>("accepttype"); entity.specnstype = row.IsNull("specnstype") ? string.Empty : row.Field <string>("specnstype"); entity.commentfl = row.Field <bool>("commentfl"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.rushfl = row.Field <bool>("rushfl"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.criticalfl = row.Field <bool>("criticalfl"); entity.superfl = row.Field <bool>("superfl"); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); 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.rowidWteral = row.Field <byte[]>("rowid-wteral").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.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); foreach (var dRow in row.GetChildRows("C_Surplus")) { Wtrrarlinedspllinesur wtrrarlinedspllinesur = new Wtrrarlinedspllinesur(); wtrrarlinedspllinesur = (Wtrrarlinedspllinesur)SetKeyFields(entity, Wtrrarlinedspllinesur.BuildWtrrarlinedspllinesurFromRow(dRow), "reportno,lineno", "reportno,lineno"); entity.wtrrarlinedspllinesur.Add(wtrrarlinedspllinesur); } return(entity); }