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

            entity.prod              = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.speccostty        = row.IsNull("speccostty") ? string.Empty : row.Field <string>("speccostty");
            entity.speccosttydisplay = row.IsNull("speccosttydisplay") ? string.Empty : row.Field <string>("speccosttydisplay");
            entity.csunperstk        = row.IsNull("csunperstk") ? decimal.Zero : row.Field <decimal>("csunperstk");
            entity.prccostper        = row.IsNull("prccostper") ? string.Empty : row.Field <string>("prccostper");
            entity.defaulttype       = row.IsNull("defaulttype") ? string.Empty : row.Field <string>("defaulttype");
            entity.statusfl          = row.Field <bool>("statusfl");
            entity.icspecrecno       = row.IsNull("icspecrecno") ? 0 : row.Field <int>("icspecrecno");
            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.rowidIcss         = row.Field <byte[]>("rowid-icss").ToStringEncoded();
            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 UpdateRowFromIcspecprccostlookupresults(ref DataRow row, Icspecprccostlookupresults entity)
 {
     row.SetField("prod", entity.prod);
     row.SetField("speccostty", entity.speccostty);
     row.SetField("speccosttydisplay", entity.speccosttydisplay);
     row.SetField("csunperstk", entity.csunperstk);
     row.SetField("prccostper", entity.prccostper);
     row.SetField("defaulttype", entity.defaulttype);
     row.SetField("statusfl", entity.statusfl);
     row.SetField("icspecrecno", entity.icspecrecno);
     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("rowid-icss", entity.rowidIcss.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }