コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcembcriteria(ref DataRow row, Icembcriteria entity)
 {
     row.SetField("product", entity.product);
     row.SetField("whse", entity.whse);
     row.SetField("fieldchanged", entity.fieldchanged);
     row.SetField("changeby", entity.changeby);
     row.SetField("changeamtdate", entity.changeamtdate);
     row.SetField("changeamtdec", entity.changeamtdec);
     row.SetField("oldvalue", entity.oldvalue);
     row.SetField("newvalue", entity.newvalue);
     row.SetField("reason", entity.reason);
     row.SetField("security", entity.security);
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Icembcriteria BuildIcembcriteriaFromRow(DataRow row)
        {
            Icembcriteria entity = new Icembcriteria();

            entity.product       = row.IsNull("product") ? string.Empty : row.Field <string>("product");
            entity.whse          = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.fieldchanged  = row.IsNull("fieldchanged") ? string.Empty : row.Field <string>("fieldchanged");
            entity.changeby      = row.IsNull("changeby") ? string.Empty : row.Field <string>("changeby");
            entity.changeamtdate = row.Field <DateTime?>("changeamtdate");
            entity.changeamtdec  = row.IsNull("changeamtdec") ? decimal.Zero : row.Field <decimal>("changeamtdec");
            entity.oldvalue      = row.IsNull("oldvalue") ? string.Empty : row.Field <string>("oldvalue");
            entity.newvalue      = row.IsNull("newvalue") ? string.Empty : row.Field <string>("newvalue");
            entity.reason        = row.IsNull("reason") ? string.Empty : row.Field <string>("reason");
            entity.security      = row.IsNull("security") ? 0 : row.Field <int>("security");
            entity.userfield     = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }