Beispiel #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromSharedpvregistry(ref DataRow row, Sharedpvregistry entity)
 {
     row.SetField("pvfunction", entity.pvfunction);
     row.SetField("pvsection", entity.pvsection);
     row.SetField("pvsubsection", entity.pvsubsection);
     row.SetField("pvobject", entity.pvobject);
     row.SetField("pvkeyname", entity.pvkeyname);
     row.SetField("pvcharvalue", entity.pvcharvalue);
     row.SetField("pvintvalue", entity.pvintvalue);
     row.SetField("pvdecvalue", entity.pvdecvalue);
     row.SetField("pvdatevalue", entity.pvdatevalue);
     row.SetField("pvlogvalue", entity.pvlogvalue);
     row.SetField("userfield", entity.userfield);
 }
Beispiel #2
0
        public static Sharedpvregistry BuildSharedpvregistryFromRow(DataRow row)
        {
            Sharedpvregistry entity = new Sharedpvregistry();

            entity.pvfunction   = row.IsNull("pvfunction") ? string.Empty : row.Field <string>("pvfunction");
            entity.pvsection    = row.IsNull("pvsection") ? string.Empty : row.Field <string>("pvsection");
            entity.pvsubsection = row.IsNull("pvsubsection") ? string.Empty : row.Field <string>("pvsubsection");
            entity.pvobject     = row.IsNull("pvobject") ? string.Empty : row.Field <string>("pvobject");
            entity.pvkeyname    = row.IsNull("pvkeyname") ? string.Empty : row.Field <string>("pvkeyname");
            entity.pvcharvalue  = row.IsNull("pvcharvalue") ? string.Empty : row.Field <string>("pvcharvalue");
            entity.pvintvalue   = row.IsNull("pvintvalue") ? 0 : row.Field <int>("pvintvalue");
            entity.pvdecvalue   = row.IsNull("pvdecvalue") ? decimal.Zero : row.Field <decimal>("pvdecvalue");
            entity.pvdatevalue  = row.Field <DateTime?>("pvdatevalue");
            entity.pvlogvalue   = row.Field <bool>("pvlogvalue");
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }