Esempio n. 1
0
        public static Icsepssi BuildIcsepssiFromRow(DataRow row)
        {
            Icsepssi entity = new Icsepssi();

            entity.cono        = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.incfl       = row.IsNull("incfl") ? string.Empty : row.Field <string>("incfl");
            entity.prod        = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.quantity    = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity");
            entity.runno       = row.IsNull("runno") ? 0 : row.Field <int>("runno");
            entity.serialno    = row.IsNull("serialno") ? string.Empty : row.Field <string>("serialno");
            entity.serlotty    = row.IsNull("serlotty") ? string.Empty : row.Field <string>("serlotty");
            entity.unavailfl   = row.Field <bool>("unavailfl");
            entity.user1       = row.IsNull("user1") ? string.Empty : row.Field <string>("user1");
            entity.user2       = row.IsNull("user2") ? string.Empty : row.Field <string>("user2");
            entity.user3       = row.IsNull("user3") ? string.Empty : row.Field <string>("user3");
            entity.user4       = row.IsNull("user4") ? string.Empty : row.Field <string>("user4");
            entity.user5       = row.IsNull("user5") ? string.Empty : row.Field <string>("user5");
            entity.user6       = row.Field <decimal?>("user6");
            entity.user7       = row.Field <decimal?>("user7");
            entity.user8       = row.Field <DateTime?>("user8");
            entity.user9       = row.Field <DateTime?>("user9");
            entity.whse        = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.icsepsRowID = row.Field <byte[]>("icsepsRowID").ToStringEncoded();
            entity.siextra     = row.IsNull("siextra") ? string.Empty : row.Field <string>("siextra");
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Esempio n. 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcsepssi(ref DataRow row, Icsepssi entity)
 {
     row.SetField("cono", entity.cono);
     row.SetField("incfl", entity.incfl);
     row.SetField("prod", entity.prod);
     row.SetField("quantity", entity.quantity);
     row.SetField("runno", entity.runno);
     row.SetField("serialno", entity.serialno);
     row.SetField("serlotty", entity.serlotty);
     row.SetField("unavailfl", entity.unavailfl);
     row.SetField("user1", entity.user1);
     row.SetField("user2", entity.user2);
     row.SetField("user3", entity.user3);
     row.SetField("user4", entity.user4);
     row.SetField("user5", entity.user5);
     row.SetField("user6", entity.user6);
     row.SetField("user7", entity.user7);
     row.SetField("user8", entity.user8);
     row.SetField("user9", entity.user9);
     row.SetField("whse", entity.whse);
     row.SetField("icsepsRowID", entity.icsepsRowID.ToByteArray());
     row.SetField("siextra", entity.siextra);
     row.SetField("userfield", entity.userfield);
 }