コード例 #1
0
        public static Wteelines BuildWteelinesFromRow(DataRow row)
        {
            Wteelines entity = new Wteelines();

            entity.actionty         = row.IsNull("actionty") ? string.Empty : row.Field <string>("actionty");
            entity.adjustfl         = row.Field <bool>("adjustfl");
            entity.csunperstk       = row.IsNull("csunperstk") ? decimal.Zero : row.Field <decimal>("csunperstk");
            entity.difference       = row.IsNull("difference") ? decimal.Zero : row.Field <decimal>("difference");
            entity.eachcost         = row.IsNull("eachcost") ? decimal.Zero : row.Field <decimal>("eachcost");
            entity.icspecrecno      = row.IsNull("icspecrecno") ? 0 : row.Field <int>("icspecrecno");
            entity.lineno           = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.nonstockty       = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty");
            entity.prccostper       = row.IsNull("prccostper") ? string.Empty : row.Field <string>("prccostper");
            entity.prodcost         = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost");
            entity.proddesc         = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc");
            entity.qtyord           = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.qtyrcv           = row.IsNull("qtyrcv") ? decimal.Zero : row.Field <decimal>("qtyrcv");
            entity.qtyship          = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship");
            entity.qtyunavail       = row.IsNull("qtyunavail") ? decimal.Zero : row.Field <decimal>("qtyunavail");
            entity.reasunavty       = row.IsNull("reasunavty") ? string.Empty : row.Field <string>("reasunavty");
            entity.serialicsnpofl   = row.Field <bool>("serialicsnpofl");
            entity.serlottype       = row.IsNull("serlottype") ? string.Empty : row.Field <string>("serlottype");
            entity.shipprod         = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod");
            entity.specconv         = row.IsNull("specconv") ? 0 : row.Field <int>("specconv");
            entity.speccostty       = row.IsNull("speccostty") ? string.Empty : row.Field <string>("speccostty");
            entity.statusmess       = row.IsNull("statusmess") ? string.Empty : row.Field <string>("statusmess");
            entity.stkqtyord        = row.IsNull("stkqtyord") ? decimal.Zero : row.Field <decimal>("stkqtyord");
            entity.stkqtyrcv        = row.IsNull("stkqtyrcv") ? decimal.Zero : row.Field <decimal>("stkqtyrcv");
            entity.stkqtyship       = row.IsNull("stkqtyship") ? decimal.Zero : row.Field <decimal>("stkqtyship");
            entity.transtype        = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype");
            entity.unit             = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.unitconv         = row.IsNull("unitconv") ? decimal.Zero : row.Field <decimal>("unitconv");
            entity.updatecompletefl = row.Field <bool>("updatecompletefl");
            entity.user1            = row.IsNull("user1") ? string.Empty : row.Field <string>("user1");
            entity.user2            = row.IsNull("user2") ? string.Empty : row.Field <string>("user2");
            entity.user3            = row.IsNull("user3") ? string.Empty : row.Field <string>("user3");
            entity.user4            = row.IsNull("user4") ? string.Empty : row.Field <string>("user4");
            entity.user5            = row.IsNull("user5") ? string.Empty : row.Field <string>("user5");
            entity.user6            = row.Field <decimal?>("user6");
            entity.user7            = row.Field <decimal?>("user7");
            entity.user8            = row.Field <DateTime?>("user8");
            entity.user9            = row.Field <DateTime?>("user9");
            entity.wtelrecid        = row.IsNull("wtelrecid") ? 0 : row.Field <long>("wtelrecid");
            entity.brandcode        = row.IsNull("brandcode") ? string.Empty : row.Field <string>("brandcode");
            entity.mfgprod          = row.IsNull("mfgprod") ? string.Empty : row.Field <string>("mfgprod");
            entity.vendprod         = row.IsNull("vendprod") ? string.Empty : row.Field <string>("vendprod");
            entity.msdsfl           = row.Field <bool>("msdsfl");
            entity.wmfl             = row.Field <bool>("wmfl");
            entity.userfield        = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
コード例 #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromWteelines(ref DataRow row, Wteelines entity)
 {
     row.SetField("actionty", entity.actionty);
     row.SetField("adjustfl", entity.adjustfl);
     row.SetField("csunperstk", entity.csunperstk);
     row.SetField("difference", entity.difference);
     row.SetField("eachcost", entity.eachcost);
     row.SetField("icspecrecno", entity.icspecrecno);
     row.SetField("lineno", entity.lineno);
     row.SetField("nonstockty", entity.nonstockty);
     row.SetField("prccostper", entity.prccostper);
     row.SetField("prodcost", entity.prodcost);
     row.SetField("proddesc", entity.proddesc);
     row.SetField("qtyord", entity.qtyord);
     row.SetField("qtyrcv", entity.qtyrcv);
     row.SetField("qtyship", entity.qtyship);
     row.SetField("qtyunavail", entity.qtyunavail);
     row.SetField("reasunavty", entity.reasunavty);
     row.SetField("serialicsnpofl", entity.serialicsnpofl);
     row.SetField("serlottype", entity.serlottype);
     row.SetField("shipprod", entity.shipprod);
     row.SetField("specconv", entity.specconv);
     row.SetField("speccostty", entity.speccostty);
     row.SetField("statusmess", entity.statusmess);
     row.SetField("stkqtyord", entity.stkqtyord);
     row.SetField("stkqtyrcv", entity.stkqtyrcv);
     row.SetField("stkqtyship", entity.stkqtyship);
     row.SetField("transtype", entity.transtype);
     row.SetField("unit", entity.unit);
     row.SetField("unitconv", entity.unitconv);
     row.SetField("updatecompletefl", entity.updatecompletefl);
     row.SetField("user1", entity.user1);
     row.SetField("user2", entity.user2);
     row.SetField("user3", entity.user3);
     row.SetField("user4", entity.user4);
     row.SetField("user5", entity.user5);
     row.SetField("user6", entity.user6);
     row.SetField("user7", entity.user7);
     row.SetField("user8", entity.user8);
     row.SetField("user9", entity.user9);
     row.SetField("wtelrecid", entity.wtelrecid);
     row.SetField("brandcode", entity.brandcode);
     row.SetField("mfgprod", entity.mfgprod);
     row.SetField("vendprod", entity.vendprod);
     row.SetField("msdsfl", entity.msdsfl);
     row.SetField("wmfl", entity.wmfl);
     row.SetField("userfield", entity.userfield);
 }