예제 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromInvmovement(ref DataRow row, Invmovement entity)
 {
     row.SetField("urgent", entity.urgent);
     row.SetField("bin_to", entity.binTo);
     row.SetField("zone_to", entity.zoneTo);
     row.SetField("quantity", entity.quantity);
     row.SetField("dept_num", entity.deptNum);
     row.SetField("lot", entity.lot);
     row.SetField("movemstRowID", entity.movemstRowID.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
예제 #2
0
        public static Invmovement BuildInvmovementFromRow(DataRow row)
        {
            Invmovement entity = new Invmovement();

            entity.urgent       = row.Field <bool>("urgent");
            entity.binTo        = row.IsNull("bin_to") ? string.Empty : row.Field <string>("bin_to");
            entity.zoneTo       = row.IsNull("zone_to") ? string.Empty : row.Field <string>("zone_to");
            entity.quantity     = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity");
            entity.deptNum      = row.IsNull("dept_num") ? 0 : row.Field <int>("dept_num");
            entity.lot          = row.IsNull("lot") ? string.Empty : row.Field <string>("lot");
            entity.movemstRowID = row.Field <byte[]>("movemstRowID").ToStringEncoded();
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }