/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPoeilistcriteria(ref DataRow row, Poeilistcriteria entity) { row.SetField("pono", entity.pono); row.SetField("posuf", entity.posuf); row.SetField("vendno", entity.vendno); row.SetField("whse", entity.whse); row.SetField("fromduedt", entity.fromduedt); row.SetField("toduedt", entity.toduedt); row.SetField("stagecd", entity.stagecd); row.SetField("sort1", entity.sort1); row.SetField("sort2", entity.sort2); row.SetField("prod", entity.prod); row.SetField("batch", entity.batch); row.SetField("jrnlno", entity.jrnlno); row.SetField("trackerno", entity.trackerno); row.SetField("transtype", entity.transtype); row.SetField("recordcountlimit", entity.recordcountlimit); row.SetField("userfield", entity.userfield); }
public static Poeilistcriteria BuildPoeilistcriteriaFromRow(DataRow row) { Poeilistcriteria entity = new Poeilistcriteria(); entity.pono = row.IsNull("pono") ? 0 : row.Field <int>("pono"); entity.posuf = row.IsNull("posuf") ? 0 : row.Field <int>("posuf"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.fromduedt = row.Field <DateTime?>("fromduedt"); entity.toduedt = row.Field <DateTime?>("toduedt"); entity.stagecd = row.IsNull("stagecd") ? string.Empty : row.Field <string>("stagecd"); entity.sort1 = row.IsNull("sort1") ? string.Empty : row.Field <string>("sort1"); entity.sort2 = row.IsNull("sort2") ? string.Empty : row.Field <string>("sort2"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.batch = row.IsNull("batch") ? string.Empty : row.Field <string>("batch"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.trackerno = row.IsNull("trackerno") ? 0 : row.Field <int>("trackerno"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.recordcountlimit = row.IsNull("recordcountlimit") ? 0 : row.Field <int>("recordcountlimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }