Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromWmbin(ref DataRow row, Wmbin entity)
 {
     row.SetField("whse", entity.whse);
     row.SetField("binloc", entity.binloc);
     row.SetField("assigncode", entity.assigncode);
     row.SetField("bintype", entity.bintype);
     row.SetField("binlength", entity.binlength);
     row.SetField("binheight", entity.binheight);
     row.SetField("priority", entity.priority);
     row.SetField("binwidth", entity.binwidth);
     row.SetField("cubes", entity.cubes);
     row.SetField("statuscode", entity.statuscode);
     row.SetField("fstoredt", entity.fstoredt);
     row.SetField("bindescrip", entity.bindescrip);
     row.SetField("lstoredt", entity.lstoredt);
     row.SetField("sizetype", entity.sizetype);
     row.SetField("sizedescrip", entity.sizedescrip);
     row.SetField("lpickdt", entity.lpickdt);
     row.SetField("pounittype", entity.pounittype);
     row.SetField("tmstored", entity.tmstored);
     row.SetField("descrip", entity.descrip);
     row.SetField("tmpicked", entity.tmpicked);
     row.SetField("multisinglefl", entity.multisinglefl);
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Wmbin BuildWmbinFromRow(DataRow row)
        {
            Wmbin entity = new Wmbin();

            entity.whse          = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.binloc        = row.IsNull("binloc") ? string.Empty : row.Field <string>("binloc");
            entity.assigncode    = row.IsNull("assigncode") ? string.Empty : row.Field <string>("assigncode");
            entity.bintype       = row.IsNull("bintype") ? string.Empty : row.Field <string>("bintype");
            entity.binlength     = row.IsNull("binlength") ? decimal.Zero : row.Field <decimal>("binlength");
            entity.binheight     = row.IsNull("binheight") ? decimal.Zero : row.Field <decimal>("binheight");
            entity.priority      = row.IsNull("priority") ? 0 : row.Field <int>("priority");
            entity.binwidth      = row.IsNull("binwidth") ? decimal.Zero : row.Field <decimal>("binwidth");
            entity.cubes         = row.IsNull("cubes") ? decimal.Zero : row.Field <decimal>("cubes");
            entity.statuscode    = row.IsNull("statuscode") ? string.Empty : row.Field <string>("statuscode");
            entity.fstoredt      = row.Field <DateTime?>("fstoredt");
            entity.bindescrip    = row.IsNull("bindescrip") ? string.Empty : row.Field <string>("bindescrip");
            entity.lstoredt      = row.Field <DateTime?>("lstoredt");
            entity.sizetype      = row.IsNull("sizetype") ? string.Empty : row.Field <string>("sizetype");
            entity.sizedescrip   = row.IsNull("sizedescrip") ? string.Empty : row.Field <string>("sizedescrip");
            entity.lpickdt       = row.Field <DateTime?>("lpickdt");
            entity.pounittype    = row.IsNull("pounittype") ? string.Empty : row.Field <string>("pounittype");
            entity.tmstored      = row.IsNull("tmstored") ? 0 : row.Field <int>("tmstored");
            entity.descrip       = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip");
            entity.tmpicked      = row.IsNull("tmpicked") ? 0 : row.Field <int>("tmpicked");
            entity.multisinglefl = row.Field <bool>("multisinglefl");
            entity.userfield     = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }