Exemple #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcamrcriteria(ref DataRow row, Icamrcriteria entity)
 {
     row.SetField("reportno", entity.reportno);
     row.SetField("whse", entity.whse);
     row.SetField("prod", entity.prod);
     row.SetField("unit", entity.unit);
     row.SetField("secure", entity.secure);
     row.SetField("monthsbackward", entity.monthsbackward);
     row.SetField("monthstrend", entity.monthstrend);
     row.SetField("monthsforward", entity.monthsforward);
     row.SetField("monthsmonthroll", entity.monthsmonthroll);
     row.SetField("exponsmooth", entity.exponsmooth);
     row.SetField("rowid-icamapm", entity.rowidIcamapm.ToByteArray());
     row.SetField("customparam", entity.customparam);
     row.SetField("userfield", entity.userfield);
 }
Exemple #2
0
        public static Icamrcriteria BuildIcamrcriteriaFromRow(DataRow row)
        {
            Icamrcriteria entity = new Icamrcriteria();

            entity.reportno        = row.IsNull("reportno") ? 0 : row.Field <int>("reportno");
            entity.whse            = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.prod            = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.unit            = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.secure          = row.IsNull("secure") ? 0 : row.Field <int>("secure");
            entity.monthsbackward  = row.IsNull("monthsbackward") ? string.Empty : row.Field <string>("monthsbackward");
            entity.monthstrend     = row.IsNull("monthstrend") ? string.Empty : row.Field <string>("monthstrend");
            entity.monthsforward   = row.IsNull("monthsforward") ? string.Empty : row.Field <string>("monthsforward");
            entity.monthsmonthroll = row.IsNull("monthsmonthroll") ? string.Empty : row.Field <string>("monthsmonthroll");
            entity.exponsmooth     = row.IsNull("exponsmooth") ? string.Empty : row.Field <string>("exponsmooth");
            entity.rowidIcamapm    = row.Field <byte[]>("rowid-icamapm").ToStringEncoded();
            entity.customparam     = row.IsNull("customparam") ? string.Empty : row.Field <string>("customparam");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }