Esempio n. 1
0
        public static Ptxsrprodlist BuildPtxsrprodlistFromRow(DataRow row)
        {
            Ptxsrprodlist entity = new Ptxsrprodlist();

            entity.keytype           = row.IsNull("keytype") ? string.Empty : row.Field <string>("keytype");
            entity.vendno            = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.shipfmno          = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno");
            entity.srcrowpointer     = row.IsNull("srcrowpointer") ? string.Empty : row.Field <string>("srcrowpointer");
            entity.custrowpointer    = row.IsNull("custrowpointer") ? string.Empty : row.Field <string>("custrowpointer");
            entity.shiptorowpointer  = row.IsNull("shiptorowpointer") ? string.Empty : row.Field <string>("shiptorowpointer");
            entity.custno            = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.custnotesfl       = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl");
            entity.custname          = row.IsNull("custname") ? string.Empty : row.Field <string>("custname");
            entity.shipto            = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.arssnotesfl       = row.IsNull("arssnotesfl") ? string.Empty : row.Field <string>("arssnotesfl");
            entity.prod              = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.prodnotesfl       = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl");
            entity.proddescrip1      = row.IsNull("proddescrip1") ? string.Empty : row.Field <string>("proddescrip1");
            entity.proddescrip2      = row.IsNull("proddescrip2") ? string.Empty : row.Field <string>("proddescrip2");
            entity.vendnotesfl       = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl");
            entity.vendname          = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname");
            entity.hierarchy         = row.IsNull("hierarchy") ? 0 : row.Field <int>("hierarchy");
            entity.prodlistuserfield = row.IsNull("prodlistuserfield") ? string.Empty : row.Field <string>("prodlistuserfield");
            entity.ptxrouterulerowid = row.Field <byte[]>("ptxrouterulerowid").ToStringEncoded();
            entity.userfield         = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Esempio n. 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPtxsrprodlist(ref DataRow row, Ptxsrprodlist entity)
 {
     row.SetField("keytype", entity.keytype);
     row.SetField("vendno", entity.vendno);
     row.SetField("shipfmno", entity.shipfmno);
     row.SetField("srcrowpointer", entity.srcrowpointer);
     row.SetField("custrowpointer", entity.custrowpointer);
     row.SetField("shiptorowpointer", entity.shiptorowpointer);
     row.SetField("custno", entity.custno);
     row.SetField("custnotesfl", entity.custnotesfl);
     row.SetField("custname", entity.custname);
     row.SetField("shipto", entity.shipto);
     row.SetField("arssnotesfl", entity.arssnotesfl);
     row.SetField("prod", entity.prod);
     row.SetField("prodnotesfl", entity.prodnotesfl);
     row.SetField("proddescrip1", entity.proddescrip1);
     row.SetField("proddescrip2", entity.proddescrip2);
     row.SetField("vendnotesfl", entity.vendnotesfl);
     row.SetField("vendname", entity.vendname);
     row.SetField("hierarchy", entity.hierarchy);
     row.SetField("prodlistuserfield", entity.prodlistuserfield);
     row.SetField("ptxrouterulerowid", entity.ptxrouterulerowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }