예제 #1
0
        public static Wtimportdata BuildWtimportdataFromRow(DataRow row)
        {
            Wtimportdata entity = new Wtimportdata();

            entity.addoncamt   = row.IsNull("addoncamt") ? decimal.Zero : row.Field <decimal>("addoncamt");
            entity.addoncty    = row.IsNull("addoncty") ? string.Empty : row.Field <string>("addoncty");
            entity.addoneamt   = row.IsNull("addoneamt") ? decimal.Zero : row.Field <decimal>("addoneamt");
            entity.addonety    = row.IsNull("addonety") ? string.Empty : row.Field <string>("addonety");
            entity.instruct    = row.IsNull("instruct") ? string.Empty : row.Field <string>("instruct");
            entity.orderdt     = row.Field <DateTime?>("orderdt");
            entity.processfl   = row.Field <bool>("processfl");
            entity.refer       = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.reqshipdt   = row.Field <DateTime?>("reqshipdt");
            entity.shipviaty   = row.IsNull("shipviaty") ? string.Empty : row.Field <string>("shipviaty");
            entity.reasoncode  = row.IsNull("reasoncode") ? string.Empty : row.Field <string>("reasoncode");
            entity.tocono      = row.IsNull("tocono") ? 0 : row.Field <int>("tocono");
            entity.towhse      = row.IsNull("towhse") ? string.Empty : row.Field <string>("towhse");
            entity.whse        = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.prod        = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.descrip     = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip");
            entity.qtyord      = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord");
            entity.unit        = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.printfl     = row.Field <bool>("printfl");
            entity.requirefl   = row.Field <bool>("requirefl");
            entity.name        = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.cono2       = row.IsNull("cono2") ? 0 : row.Field <int>("cono2");
            entity.duedt       = row.Field <DateTime?>("duedt");
            entity.ordertype   = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype");
            entity.origseqno   = row.IsNull("origseqno") ? 0 : row.Field <int>("origseqno");
            entity.stagecd     = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd");
            entity.totamt      = row.IsNull("totamt") ? decimal.Zero : row.Field <decimal>("totamt");
            entity.addonno     = row.IsNull("addonno") ? 0 : row.Field <int>("addonno");
            entity.addontype1  = row.Field <bool>("addontype1");
            entity.catalogfl   = row.Field <bool>("catalogfl");
            entity.commentfl   = row.IsNull("commentfl") ? string.Empty : row.Field <string>("commentfl");
            entity.currsymbol  = row.IsNull("currsymbol") ? string.Empty : row.Field <string>("currsymbol");
            entity.descrip2    = row.IsNull("descrip2") ? string.Empty : row.Field <string>("descrip2");
            entity.manprice    = row.Field <bool>("manprice");
            entity.netamt      = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt");
            entity.nonstockty  = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty");
            entity.orderaltno  = row.IsNull("orderaltno") ? 0 : row.Field <int>("orderaltno");
            entity.prodcat     = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat");
            entity.prodline    = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline");
            entity.qtyship     = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship");
            entity.reasunavty  = row.IsNull("reasunavty") ? string.Empty : row.Field <string>("reasunavty");
            entity.vendprod    = row.IsNull("vendprod") ? string.Empty : row.Field <string>("vendprod");
            entity.lineno      = row.IsNull("lineno") ? 0 : row.Field <int>("lineno");
            entity.seqno       = row.IsNull("seqno") ? 0 : row.Field <int>("seqno");
            entity.orderbreak  = row.IsNull("orderbreak") ? string.Empty : row.Field <string>("orderbreak");
            entity.worksheetno = row.IsNull("worksheetno") ? 0 : row.Field <int>("worksheetno");
            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 UpdateRowFromWtimportdata(ref DataRow row, Wtimportdata entity)
 {
     row.SetField("addoncamt", entity.addoncamt);
     row.SetField("addoncty", entity.addoncty);
     row.SetField("addoneamt", entity.addoneamt);
     row.SetField("addonety", entity.addonety);
     row.SetField("instruct", entity.instruct);
     row.SetField("orderdt", entity.orderdt);
     row.SetField("processfl", entity.processfl);
     row.SetField("refer", entity.refer);
     row.SetField("reqshipdt", entity.reqshipdt);
     row.SetField("shipviaty", entity.shipviaty);
     row.SetField("reasoncode", entity.reasoncode);
     row.SetField("tocono", entity.tocono);
     row.SetField("towhse", entity.towhse);
     row.SetField("whse", entity.whse);
     row.SetField("prod", entity.prod);
     row.SetField("descrip", entity.descrip);
     row.SetField("qtyord", entity.qtyord);
     row.SetField("unit", entity.unit);
     row.SetField("printfl", entity.printfl);
     row.SetField("requirefl", entity.requirefl);
     row.SetField("name", entity.name);
     row.SetField("cono2", entity.cono2);
     row.SetField("duedt", entity.duedt);
     row.SetField("ordertype", entity.ordertype);
     row.SetField("origseqno", entity.origseqno);
     row.SetField("stagecd", entity.stagecd);
     row.SetField("totamt", entity.totamt);
     row.SetField("addonno", entity.addonno);
     row.SetField("addontype1", entity.addontype1);
     row.SetField("catalogfl", entity.catalogfl);
     row.SetField("commentfl", entity.commentfl);
     row.SetField("currsymbol", entity.currsymbol);
     row.SetField("descrip2", entity.descrip2);
     row.SetField("manprice", entity.manprice);
     row.SetField("netamt", entity.netamt);
     row.SetField("nonstockty", entity.nonstockty);
     row.SetField("orderaltno", entity.orderaltno);
     row.SetField("prodcat", entity.prodcat);
     row.SetField("prodline", entity.prodline);
     row.SetField("qtyship", entity.qtyship);
     row.SetField("reasunavty", entity.reasunavty);
     row.SetField("vendprod", entity.vendprod);
     row.SetField("lineno", entity.lineno);
     row.SetField("seqno", entity.seqno);
     row.SetField("orderbreak", entity.orderbreak);
     row.SetField("worksheetno", entity.worksheetno);
     row.SetField("userfield", entity.userfield);
 }