Beispiel #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromLotcutlist(ref DataRow row, Lotcutlist entity)
 {
     row.SetField("lotno", entity.lotno);
     row.SetField("seqno", entity.seqno);
     row.SetField("unavailfl", entity.unavailfl);
     row.SetField("conditioncd", entity.conditioncd);
     row.SetField("quantity", entity.quantity);
     row.SetField("length1", entity.length1);
     row.SetField("length2", entity.length2);
     row.SetField("length3", entity.length3);
     row.SetField("lengthunit", entity.lengthunit);
     row.SetField("width1", entity.width1);
     row.SetField("width2", entity.width2);
     row.SetField("width3", entity.width3);
     row.SetField("widthunit", entity.widthunit);
     row.SetField("selectedfl", entity.selectedfl);
     row.SetField("icselcrowid", entity.icselcrowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Beispiel #2
0
        public static Lotcutlist BuildLotcutlistFromRow(DataRow row)
        {
            Lotcutlist entity = new Lotcutlist();

            entity.lotno       = row.IsNull("lotno") ? string.Empty : row.Field <string>("lotno");
            entity.seqno       = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.unavailfl   = row.Field <bool>("unavailfl");
            entity.conditioncd = row.IsNull("conditioncd") ? string.Empty : row.Field <string>("conditioncd");
            entity.quantity    = row.IsNull("quantity") ? decimal.Zero : row.Field <decimal>("quantity");
            entity.length1     = row.IsNull("length1") ? decimal.Zero : row.Field <decimal>("length1");
            entity.length2     = row.IsNull("length2") ? decimal.Zero : row.Field <decimal>("length2");
            entity.length3     = row.IsNull("length3") ? decimal.Zero : row.Field <decimal>("length3");
            entity.lengthunit  = row.IsNull("lengthunit") ? string.Empty : row.Field <string>("lengthunit");
            entity.width1      = row.IsNull("width1") ? decimal.Zero : row.Field <decimal>("width1");
            entity.width2      = row.IsNull("width2") ? decimal.Zero : row.Field <decimal>("width2");
            entity.width3      = row.IsNull("width3") ? decimal.Zero : row.Field <decimal>("width3");
            entity.widthunit   = row.IsNull("widthunit") ? string.Empty : row.Field <string>("widthunit");
            entity.selectedfl  = row.Field <bool>("selectedfl");
            entity.icselcrowid = row.Field <byte[]>("icselcrowid").ToStringEncoded();
            entity.userfield   = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }