Example #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromIcsoesetup(ref DataRow row, Icsoesetup entity)
 {
     row.SetField("state", entity.state);
     row.SetField("statedesc", entity.statedesc);
     row.SetField("addonno", entity.addonno);
     row.SetField("addondesc", entity.addondesc);
     row.SetField("startdt", entity.startdt);
     row.SetField("enddt", entity.enddt);
     row.SetField("certificate", entity.certificate);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("prod", entity.prod);
     row.SetField("unit", entity.unit);
     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("userfield", entity.userfield);
     row.SetField("arsrcrowpointer", entity.arsrcrowpointer);
     row.SetField("icsrcrowpointer", entity.icsrcrowpointer);
     row.SetField("icsoerowid", entity.icsoerowid.ToByteArray());
 }
Example #2
0
        public static Icsoesetup BuildIcsoesetupFromRow(DataRow row)
        {
            Icsoesetup entity = new Icsoesetup();

            entity.state           = row.IsNull("state") ? string.Empty : row.Field <string>("state");
            entity.statedesc       = row.IsNull("statedesc") ? string.Empty : row.Field <string>("statedesc");
            entity.addonno         = row.IsNull("addonno") ? 0 : row.Field <int>("addonno");
            entity.addondesc       = row.IsNull("addondesc") ? string.Empty : row.Field <string>("addondesc");
            entity.startdt         = row.Field <DateTime?>("startdt");
            entity.enddt           = row.Field <DateTime?>("enddt");
            entity.certificate     = row.IsNull("certificate") ? string.Empty : row.Field <string>("certificate");
            entity.custno          = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto          = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.prod            = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.unit            = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            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.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            entity.arsrcrowpointer = row.IsNull("arsrcrowpointer") ? string.Empty : row.Field <string>("arsrcrowpointer");
            entity.icsrcrowpointer = row.IsNull("icsrcrowpointer") ? string.Empty : row.Field <string>("icsrcrowpointer");
            entity.icsoerowid      = row.Field <byte[]>("icsoerowid").ToStringEncoded();
            return(entity);
        }