/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdevupdatecostscriteria(ref DataRow row, Pdevupdatecostscriteria entity) { row.SetField("prod", entity.prod); row.SetField("whse", entity.whse); row.SetField("jrnlno", entity.jrnlno); row.SetField("lastcosttyp", entity.lastcosttyp); row.SetField("lastcostamt", entity.lastcostamt); row.SetField("lastcostnew", entity.lastcostnew); row.SetField("lastcsttydesc", entity.lastcsttydesc); row.SetField("replcosttyp", entity.replcosttyp); row.SetField("replcostamt", entity.replcostamt); row.SetField("replcostnew", entity.replcostnew); row.SetField("replcsttydesc", entity.replcsttydesc); row.SetField("avgcosttyp", entity.avgcosttyp); row.SetField("avgcostamt", entity.avgcostamt); row.SetField("avgcostnew", entity.avgcostnew); row.SetField("avgcsttydesc", entity.avgcsttydesc); row.SetField("stndcosttyp", entity.stndcosttyp); row.SetField("stndcostamt", entity.stndcostamt); row.SetField("stndcostnew", entity.stndcostnew); row.SetField("stndcsttydesc", entity.stndcsttydesc); row.SetField("rebatecosttyp", entity.rebatecosttyp); row.SetField("rebatecostamt", entity.rebatecostamt); row.SetField("rebatecostnew", entity.rebatecostnew); row.SetField("rebcsttydesc", entity.rebcsttydesc); row.SetField("replcostdt", entity.replcostdt); row.SetField("stndcostdt", entity.stndcostdt); row.SetField("userfield", entity.userfield); }
public static Pdevupdatecostscriteria BuildPdevupdatecostscriteriaFromRow(DataRow row) { Pdevupdatecostscriteria entity = new Pdevupdatecostscriteria(); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.lastcosttyp = row.IsNull("lastcosttyp") ? string.Empty : row.Field <string>("lastcosttyp"); entity.lastcostamt = row.IsNull("lastcostamt") ? decimal.Zero : row.Field <decimal>("lastcostamt"); entity.lastcostnew = row.IsNull("lastcostnew") ? decimal.Zero : row.Field <decimal>("lastcostnew"); entity.lastcsttydesc = row.IsNull("lastcsttydesc") ? string.Empty : row.Field <string>("lastcsttydesc"); entity.replcosttyp = row.IsNull("replcosttyp") ? string.Empty : row.Field <string>("replcosttyp"); entity.replcostamt = row.IsNull("replcostamt") ? decimal.Zero : row.Field <decimal>("replcostamt"); entity.replcostnew = row.IsNull("replcostnew") ? decimal.Zero : row.Field <decimal>("replcostnew"); entity.replcsttydesc = row.IsNull("replcsttydesc") ? string.Empty : row.Field <string>("replcsttydesc"); entity.avgcosttyp = row.IsNull("avgcosttyp") ? string.Empty : row.Field <string>("avgcosttyp"); entity.avgcostamt = row.IsNull("avgcostamt") ? decimal.Zero : row.Field <decimal>("avgcostamt"); entity.avgcostnew = row.IsNull("avgcostnew") ? decimal.Zero : row.Field <decimal>("avgcostnew"); entity.avgcsttydesc = row.IsNull("avgcsttydesc") ? string.Empty : row.Field <string>("avgcsttydesc"); entity.stndcosttyp = row.IsNull("stndcosttyp") ? string.Empty : row.Field <string>("stndcosttyp"); entity.stndcostamt = row.IsNull("stndcostamt") ? decimal.Zero : row.Field <decimal>("stndcostamt"); entity.stndcostnew = row.IsNull("stndcostnew") ? decimal.Zero : row.Field <decimal>("stndcostnew"); entity.stndcsttydesc = row.IsNull("stndcsttydesc") ? string.Empty : row.Field <string>("stndcsttydesc"); entity.rebatecosttyp = row.IsNull("rebatecosttyp") ? string.Empty : row.Field <string>("rebatecosttyp"); entity.rebatecostamt = row.IsNull("rebatecostamt") ? decimal.Zero : row.Field <decimal>("rebatecostamt"); entity.rebatecostnew = row.IsNull("rebatecostnew") ? decimal.Zero : row.Field <decimal>("rebatecostnew"); entity.rebcsttydesc = row.IsNull("rebcsttydesc") ? string.Empty : row.Field <string>("rebcsttydesc"); entity.replcostdt = row.Field <DateTime?>("replcostdt"); entity.stndcostdt = row.Field <DateTime?>("stndcostdt"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }