Exemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOtaddons(ref DataRow row, Otaddons entity)
 {
     row.SetField("trackno", entity.trackno);
     row.SetField("addonseqno", entity.addonseqno);
     row.SetField("addonno", entity.addonno);
     row.SetField("addonamt", entity.addonamt);
     row.SetField("addontype", entity.addontype);
     row.SetField("addonnet", entity.addonnet);
     row.SetField("addondistr", entity.addondistr);
     row.SetField("addondesc", entity.addondesc);
     row.SetField("distrenabled", entity.distrenabled);
     row.SetField("userfield", entity.userfield);
 }
Exemplo n.º 2
0
        public static Otaddons BuildOtaddonsFromRow(DataRow row)
        {
            Otaddons entity = new Otaddons();

            entity.trackno      = row.IsNull("trackno") ? 0 : row.Field <int>("trackno");
            entity.addonseqno   = row.IsNull("addonseqno") ? 0 : row.Field <int>("addonseqno");
            entity.addonno      = row.IsNull("addonno") ? 0 : row.Field <int>("addonno");
            entity.addonamt     = row.IsNull("addonamt") ? decimal.Zero : row.Field <decimal>("addonamt");
            entity.addontype    = row.Field <bool>("addontype");
            entity.addonnet     = row.IsNull("addonnet") ? decimal.Zero : row.Field <decimal>("addonnet");
            entity.addondistr   = row.IsNull("addondistr") ? string.Empty : row.Field <string>("addondistr");
            entity.addondesc    = row.IsNull("addondesc") ? string.Empty : row.Field <string>("addondesc");
            entity.distrenabled = row.Field <bool>("distrenabled");
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }