/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdsrlookupcriteria(ref DataRow row, Pdsrlookupcriteria entity) { row.SetField("levelcd", entity.levelcd); row.SetField("rebatecd", entity.rebatecd); row.SetField("shiptype", entity.shiptype); row.SetField("prod", entity.prod); row.SetField("vendno", entity.vendno); row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("rebtype", entity.rebtype); row.SetField("rebsubty", entity.rebsubty); row.SetField("custrebty", entity.custrebty); row.SetField("prodpricety", entity.prodpricety); row.SetField("prodline", entity.prodline); row.SetField("prodcat", entity.prodcat); row.SetField("whse", entity.whse); row.SetField("recordcountlimit", entity.recordcountlimit); row.SetField("userfield", entity.userfield); }
public static Pdsrlookupcriteria BuildPdsrlookupcriteriaFromRow(DataRow row) { Pdsrlookupcriteria entity = new Pdsrlookupcriteria(); entity.levelcd = row.IsNull("levelcd") ? string.Empty : row.Field <string>("levelcd"); entity.rebatecd = row.IsNull("rebatecd") ? string.Empty : row.Field <string>("rebatecd"); entity.shiptype = row.IsNull("shiptype") ? string.Empty : row.Field <string>("shiptype"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.rebtype = row.IsNull("rebtype") ? string.Empty : row.Field <string>("rebtype"); entity.rebsubty = row.IsNull("rebsubty") ? string.Empty : row.Field <string>("rebsubty"); entity.custrebty = row.IsNull("custrebty") ? string.Empty : row.Field <string>("custrebty"); entity.prodpricety = row.IsNull("prodpricety") ? string.Empty : row.Field <string>("prodpricety"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.recordcountlimit = row.IsNull("recordcountlimit") ? 0 : row.Field <int>("recordcountlimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }