Exemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromArsdlookupresults(ref DataRow row, Arsdlookupresults entity)
 {
     row.SetField("cardno", entity.cardno);
     row.SetField("cono", entity.cono);
     row.SetField("custno", entity.custno);
     row.SetField("maxamount", entity.maxamount);
     row.SetField("mediacd", entity.mediacd);
     row.SetField("name", entity.name);
     row.SetField("seqno", entity.seqno);
     row.SetField("shipto", entity.shipto);
     row.SetField("mediadesc", entity.mediadesc);
     row.SetField("userfield", entity.userfield);
 }
Exemplo n.º 2
0
        public static Arsdlookupresults BuildArsdlookupresultsFromRow(DataRow row)
        {
            Arsdlookupresults entity = new Arsdlookupresults();

            entity.cardno    = row.IsNull("cardno") ? string.Empty : row.Field <string>("cardno");
            entity.cono      = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.custno    = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.maxamount = row.IsNull("maxamount") ? decimal.Zero : row.Field <decimal>("maxamount");
            entity.mediacd   = row.IsNull("mediacd") ? 0 : row.Field <int>("mediacd");
            entity.name      = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.seqno     = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.shipto    = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.mediadesc = row.IsNull("mediadesc") ? string.Empty : row.Field <string>("mediadesc");
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }