Beispiel #1
0
        public static Wtrrarreptheader BuildWtrrarreptheaderFromRow(DataRow row)
        {
            Wtrrarreptheader entity = new Wtrrarreptheader();

            entity.reportno          = row.IsNull("reportno") ? 0 : row.Field <int>("reportno");
            entity.shipfmwhse        = row.IsNull("shipfmwhse") ? string.Empty : row.Field <string>("shipfmwhse");
            entity.shiptowhse        = row.IsNull("shiptowhse") ? string.Empty : row.Field <string>("shiptowhse");
            entity.shiptowhsename    = row.IsNull("shiptowhsename") ? string.Empty : row.Field <string>("shiptowhsename");
            entity.tocono            = row.IsNull("tocono") ? 0 : row.Field <int>("tocono");
            entity.shipfmname        = row.IsNull("shipfmname") ? string.Empty : row.Field <string>("shipfmname");
            entity.shipfmaddr1       = row.IsNull("shipfmaddr1") ? string.Empty : row.Field <string>("shipfmaddr1");
            entity.shipfmaddr2       = row.IsNull("shipfmaddr2") ? string.Empty : row.Field <string>("shipfmaddr2");
            entity.shipfmaddr3       = row.IsNull("shipfmaddr3") ? string.Empty : row.Field <string>("shipfmaddr3");
            entity.shipfmcity        = row.IsNull("shipfmcity") ? string.Empty : row.Field <string>("shipfmcity");
            entity.shipfmstate       = row.IsNull("shipfmstate") ? string.Empty : row.Field <string>("shipfmstate");
            entity.shipfmzipcd       = row.IsNull("shipfmzipcd") ? string.Empty : row.Field <string>("shipfmzipcd");
            entity.freeformaddrfl    = row.Field <bool>("freeformaddrfl");
            entity.shiptoname        = row.IsNull("shiptoname") ? string.Empty : row.Field <string>("shiptoname");
            entity.shiptoaddr1       = row.IsNull("shiptoaddr1") ? string.Empty : row.Field <string>("shiptoaddr1");
            entity.shiptoaddr2       = row.IsNull("shiptoaddr2") ? string.Empty : row.Field <string>("shiptoaddr2");
            entity.shiptoaddr3       = row.IsNull("shiptoaddr3") ? string.Empty : row.Field <string>("shiptoaddr3");
            entity.shiptocity        = row.IsNull("shiptocity") ? string.Empty : row.Field <string>("shiptocity");
            entity.shiptostate       = row.IsNull("shiptostate") ? string.Empty : row.Field <string>("shiptostate");
            entity.shiptozip         = row.IsNull("shiptozip") ? string.Empty : row.Field <string>("shiptozip");
            entity.shiptoaddrenabled = row.Field <bool>("shiptoaddrenabled");
            entity.shipfmphoneno     = row.IsNull("shipfmphoneno") ? string.Empty : row.Field <string>("shipfmphoneno");
            entity.shiptophoneno     = row.IsNull("shiptophoneno") ? string.Empty : row.Field <string>("shiptophoneno");
            entity.shipinstr         = row.IsNull("shipinstr") ? string.Empty : row.Field <string>("shipinstr");
            entity.refer             = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.reqshipdt         = row.Field <DateTime?>("reqshipdt");
            entity.rushfl            = row.Field <bool>("rushfl");
            entity.duedt             = row.Field <DateTime?>("duedt");
            entity.shipviaty         = row.IsNull("shipviaty") ? string.Empty : row.Field <string>("shipviaty");
            entity.shipviatydesc     = row.IsNull("shipviatydesc") ? string.Empty : row.Field <string>("shipviatydesc");
            entity.reasoncode        = row.IsNull("reasoncode") ? string.Empty : row.Field <string>("reasoncode");
            entity.reasoncodedesc    = row.IsNull("reasoncodedesc") ? string.Empty : row.Field <string>("reasoncodedesc");
            entity.ignoreltfl        = row.Field <bool>("ignoreltfl");
            entity.wtauth            = row.IsNull("wtauth") ? 0 : row.Field <int>("wtauth");
            entity.addontype1        = row.IsNull("addontype1") ? string.Empty : row.Field <string>("addontype1");
            entity.addontype2        = row.IsNull("addontype2") ? string.Empty : row.Field <string>("addontype2");
            entity.addonamt1         = row.IsNull("addonamt1") ? decimal.Zero : row.Field <decimal>("addonamt1");
            entity.addonamt2         = row.IsNull("addonamt2") ? decimal.Zero : row.Field <decimal>("addonamt2");
            entity.totweight         = row.IsNull("totweight") ? decimal.Zero : row.Field <decimal>("totweight");
            entity.totcubes          = row.IsNull("totcubes") ? decimal.Zero : row.Field <decimal>("totcubes");
            entity.totqtyord         = row.IsNull("totqtyord") ? decimal.Zero : row.Field <decimal>("totqtyord");
            entity.totlineamt        = row.IsNull("totlineamt") ? decimal.Zero : row.Field <decimal>("totlineamt");
            entity.markupaddonfl     = row.Field <bool>("markupaddonfl");
            entity.wterahRowid       = row.Field <byte[]>("wterah-rowid").ToStringEncoded();
            entity.userfield         = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Beispiel #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromWtrrarreptheader(ref DataRow row, Wtrrarreptheader entity)
 {
     row.SetField("reportno", entity.reportno);
     row.SetField("shipfmwhse", entity.shipfmwhse);
     row.SetField("shiptowhse", entity.shiptowhse);
     row.SetField("shiptowhsename", entity.shiptowhsename);
     row.SetField("tocono", entity.tocono);
     row.SetField("shipfmname", entity.shipfmname);
     row.SetField("shipfmaddr1", entity.shipfmaddr1);
     row.SetField("shipfmaddr2", entity.shipfmaddr2);
     row.SetField("shipfmaddr3", entity.shipfmaddr3);
     row.SetField("shipfmcity", entity.shipfmcity);
     row.SetField("shipfmstate", entity.shipfmstate);
     row.SetField("shipfmzipcd", entity.shipfmzipcd);
     row.SetField("freeformaddrfl", entity.freeformaddrfl);
     row.SetField("shiptoname", entity.shiptoname);
     row.SetField("shiptoaddr1", entity.shiptoaddr1);
     row.SetField("shiptoaddr2", entity.shiptoaddr2);
     row.SetField("shiptoaddr3", entity.shiptoaddr3);
     row.SetField("shiptocity", entity.shiptocity);
     row.SetField("shiptostate", entity.shiptostate);
     row.SetField("shiptozip", entity.shiptozip);
     row.SetField("shiptoaddrenabled", entity.shiptoaddrenabled);
     row.SetField("shipfmphoneno", entity.shipfmphoneno);
     row.SetField("shiptophoneno", entity.shiptophoneno);
     row.SetField("shipinstr", entity.shipinstr);
     row.SetField("refer", entity.refer);
     row.SetField("reqshipdt", entity.reqshipdt);
     row.SetField("rushfl", entity.rushfl);
     row.SetField("duedt", entity.duedt);
     row.SetField("shipviaty", entity.shipviaty);
     row.SetField("shipviatydesc", entity.shipviatydesc);
     row.SetField("reasoncode", entity.reasoncode);
     row.SetField("reasoncodedesc", entity.reasoncodedesc);
     row.SetField("ignoreltfl", entity.ignoreltfl);
     row.SetField("wtauth", entity.wtauth);
     row.SetField("addontype1", entity.addontype1);
     row.SetField("addontype2", entity.addontype2);
     row.SetField("addonamt1", entity.addonamt1);
     row.SetField("addonamt2", entity.addonamt2);
     row.SetField("totweight", entity.totweight);
     row.SetField("totcubes", entity.totcubes);
     row.SetField("totqtyord", entity.totqtyord);
     row.SetField("totlineamt", entity.totlineamt);
     row.SetField("markupaddonfl", entity.markupaddonfl);
     row.SetField("wterah-rowid", entity.wterahRowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }