Ejemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromArshiptocopy(ref DataRow row, Arshiptocopy entity)
 {
     row.SetField("fromcustno", entity.fromcustno);
     row.SetField("fromshipto", entity.fromshipto);
     row.SetField("tocustno", entity.tocustno);
     row.SetField("toshipto", entity.toshipto);
     row.SetField("name", entity.name);
     row.SetField("createdby", entity.createdby);
     row.SetField("createddt", entity.createddt);
     row.SetField("createdproc", entity.createdproc);
     row.SetField("createdtm", entity.createdtm);
     row.SetField("rowid", entity.rowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Ejemplo n.º 2
0
        public static Arshiptocopy BuildArshiptocopyFromRow(DataRow row)
        {
            Arshiptocopy entity = new Arshiptocopy();

            entity.fromcustno  = row.IsNull("fromcustno") ? decimal.Zero : row.Field <decimal>("fromcustno");
            entity.fromshipto  = row.IsNull("fromshipto") ? string.Empty : row.Field <string>("fromshipto");
            entity.tocustno    = row.IsNull("tocustno") ? decimal.Zero : row.Field <decimal>("tocustno");
            entity.toshipto    = row.IsNull("toshipto") ? string.Empty : row.Field <string>("toshipto");
            entity.name        = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.createdby   = row.IsNull("createdby") ? string.Empty : row.Field <string>("createdby");
            entity.createddt   = row.Field <DateTime?>("createddt");
            entity.createdproc = row.IsNull("createdproc") ? string.Empty : row.Field <string>("createdproc");
            entity.createdtm   = row.IsNull("createdtm") ? string.Empty : row.Field <string>("createdtm");
            entity.rowid       = row.Field <byte[]>("rowid").ToStringEncoded();
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }