예제 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPricesheetdatacriteria(ref DataRow row, Pricesheetdatacriteria entity)
 {
     row.SetField("prod", entity.prod);
     row.SetField("whse", entity.whse);
     row.SetField("effectivedt", entity.effectivedt);
     row.SetField("pricesheet", entity.pricesheet);
     row.SetField("pdrecno", entity.pdrecno);
     row.SetField("pdrowid", entity.pdrowid.ToByteArray());
     row.SetField("basedon", entity.basedon);
     row.SetField("userfield", entity.userfield);
 }
예제 #2
0
        public static Pricesheetdatacriteria BuildPricesheetdatacriteriaFromRow(DataRow row)
        {
            Pricesheetdatacriteria entity = new Pricesheetdatacriteria();

            entity.prod        = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.whse        = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.effectivedt = row.Field <DateTime?>("effectivedt");
            entity.pricesheet  = row.IsNull("pricesheet") ? string.Empty : row.Field <string>("pricesheet");
            entity.pdrecno     = row.IsNull("pdrecno") ? 0 : row.Field <int>("pdrecno");
            entity.pdrowid     = row.Field <byte[]>("pdrowid").ToStringEncoded();
            entity.basedon     = row.IsNull("basedon") ? string.Empty : row.Field <string>("basedon");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }