Example #1
0
        public static Pdinlinesresults BuildPdinlinesresultsFromRow(DataRow row)
        {
            Pdinlinesresults entity = new Pdinlinesresults();

            entity.orderno      = row.IsNull("orderno") ? string.Empty : row.Field <string>("orderno");
            entity.lineno       = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.prod         = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.npcd         = row.IsNull("npcd") ? string.Empty : row.Field <string>("npcd");
            entity.pdsnrecno    = row.IsNull("pdsnrecno") ? 0 : row.Field <int>("pdsnrecno");
            entity.claimqty     = row.IsNull("claimqty") ? decimal.Zero : row.Field <decimal>("claimqty");
            entity.claimunit    = row.IsNull("claimunit") ? string.Empty : row.Field <string>("claimunit");
            entity.claimprc     = row.IsNull("claimprc") ? decimal.Zero : row.Field <decimal>("claimprc");
            entity.claimnetamt  = row.IsNull("claimnetamt") ? decimal.Zero : row.Field <decimal>("claimnetamt");
            entity.paidqty      = row.IsNull("paidqty") ? decimal.Zero : row.Field <decimal>("paidqty");
            entity.paidunitconv = row.IsNull("paidunitconv") ? decimal.Zero : row.Field <decimal>("paidunitconv");
            entity.paidprc      = row.IsNull("paidprc") ? decimal.Zero : row.Field <decimal>("paidprc");
            entity.paidnetamt   = row.IsNull("paidnetamt") ? decimal.Zero : row.Field <decimal>("paidnetamt");
            entity.varAmt       = row.IsNull("varAmt") ? decimal.Zero : row.Field <decimal>("varAmt");
            entity.varPct       = row.IsNull("varPct") ? decimal.Zero : row.Field <decimal>("varPct");
            entity.tolexpfl     = row.Field <bool>("tolexpfl");
            entity.tolexpflv    = row.Field <bool>("tolexpflv");
            entity.pdenlrowid   = row.Field <byte[]>("pdenlrowid").ToStringEncoded();
            entity.userfield    = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Example #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPdinlinesresults(ref DataRow row, Pdinlinesresults entity)
 {
     row.SetField("orderno", entity.orderno);
     row.SetField("lineno", entity.lineno);
     row.SetField("prod", entity.prod);
     row.SetField("npcd", entity.npcd);
     row.SetField("pdsnrecno", entity.pdsnrecno);
     row.SetField("claimqty", entity.claimqty);
     row.SetField("claimunit", entity.claimunit);
     row.SetField("claimprc", entity.claimprc);
     row.SetField("claimnetamt", entity.claimnetamt);
     row.SetField("paidqty", entity.paidqty);
     row.SetField("paidunitconv", entity.paidunitconv);
     row.SetField("paidprc", entity.paidprc);
     row.SetField("paidnetamt", entity.paidnetamt);
     row.SetField("varAmt", entity.varAmt);
     row.SetField("varPct", entity.varPct);
     row.SetField("tolexpfl", entity.tolexpfl);
     row.SetField("tolexpflv", entity.tolexpflv);
     row.SetField("pdenlrowid", entity.pdenlrowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }