Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromApembsingle(ref DataRow row, Apembsingle entity)
 {
     row.SetField("vendno", entity.vendno);
     row.SetField("changefield", entity.changefield);
     row.SetField("changedate", entity.changedate);
     row.SetField("changetime", entity.changetime);
     row.SetField("changeoper", entity.changeoper);
     row.SetField("changetype", entity.changetype);
     row.SetField("changevalue", entity.changevalue);
     row.SetField("newvalue", entity.newvalue);
     row.SetField("oldvalue", entity.oldvalue);
     row.SetField("reason", entity.reason);
     row.SetField("appliedfl", entity.appliedfl);
     row.SetField("currencyty", entity.currencyty);
     row.SetField("apsvrowid", entity.apsvrowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Apembsingle BuildApembsingleFromRow(DataRow row)
        {
            Apembsingle entity = new Apembsingle();

            entity.vendno      = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.changefield = row.IsNull("changefield") ? string.Empty : row.Field <string>("changefield");
            entity.changedate  = row.Field <DateTime?>("changedate");
            entity.changetime  = row.IsNull("changetime") ? string.Empty : row.Field <string>("changetime");
            entity.changeoper  = row.IsNull("changeoper") ? string.Empty : row.Field <string>("changeoper");
            entity.changetype  = row.IsNull("changetype") ? string.Empty : row.Field <string>("changetype");
            entity.changevalue = row.IsNull("changevalue") ? string.Empty : row.Field <string>("changevalue");
            entity.newvalue    = row.IsNull("newvalue") ? string.Empty : row.Field <string>("newvalue");
            entity.oldvalue    = row.IsNull("oldvalue") ? string.Empty : row.Field <string>("oldvalue");
            entity.reason      = row.IsNull("reason") ? string.Empty : row.Field <string>("reason");
            entity.appliedfl   = row.Field <bool>("appliedfl");
            entity.currencyty  = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty");
            entity.apsvrowid   = row.Field <byte[]>("apsvrowid").ToStringEncoded();
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }