Ejemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromSasgscopy(ref DataRow row, Sasgscopy entity)
 {
     row.SetField("fromrecty", entity.fromrecty);
     row.SetField("fromtaxgroup", entity.fromtaxgroup);
     row.SetField("fromstatecd", entity.fromstatecd);
     row.SetField("fromcountycd", entity.fromcountycd);
     row.SetField("fromcitycd", entity.fromcitycd);
     row.SetField("fromothercd", entity.fromothercd);
     row.SetField("torecty", entity.torecty);
     row.SetField("totaxgroup", entity.totaxgroup);
     row.SetField("tostatecd", entity.tostatecd);
     row.SetField("tocountycd", entity.tocountycd);
     row.SetField("tocitycd", entity.tocitycd);
     row.SetField("toothercd", entity.toothercd);
     row.SetField("todescrip", entity.todescrip);
     row.SetField("rowid", entity.rowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Ejemplo n.º 2
0
        public static Sasgscopy BuildSasgscopyFromRow(DataRow row)
        {
            Sasgscopy entity = new Sasgscopy();

            entity.fromrecty    = row.IsNull("fromrecty") ? 0 : row.Field <int>("fromrecty");
            entity.fromtaxgroup = row.IsNull("fromtaxgroup") ? 0 : row.Field <int>("fromtaxgroup");
            entity.fromstatecd  = row.IsNull("fromstatecd") ? string.Empty : row.Field <string>("fromstatecd");
            entity.fromcountycd = row.IsNull("fromcountycd") ? string.Empty : row.Field <string>("fromcountycd");
            entity.fromcitycd   = row.IsNull("fromcitycd") ? string.Empty : row.Field <string>("fromcitycd");
            entity.fromothercd  = row.IsNull("fromothercd") ? string.Empty : row.Field <string>("fromothercd");
            entity.torecty      = row.IsNull("torecty") ? 0 : row.Field <int>("torecty");
            entity.totaxgroup   = row.IsNull("totaxgroup") ? 0 : row.Field <int>("totaxgroup");
            entity.tostatecd    = row.IsNull("tostatecd") ? string.Empty : row.Field <string>("tostatecd");
            entity.tocountycd   = row.IsNull("tocountycd") ? string.Empty : row.Field <string>("tocountycd");
            entity.tocitycd     = row.IsNull("tocitycd") ? string.Empty : row.Field <string>("tocitycd");
            entity.toothercd    = row.IsNull("toothercd") ? string.Empty : row.Field <string>("toothercd");
            entity.todescrip    = row.IsNull("todescrip") ? string.Empty : row.Field <string>("todescrip");
            entity.rowid        = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }