예제 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromVendorshipfromresults(ref DataRow row, Vendorshipfromresults entity)
 {
     row.SetField("co_num", entity.coNum);
     row.SetField("wh_num", entity.whNum);
     row.SetField("vendor_id", entity.vendorId);
     row.SetField("edi_code", entity.ediCode);
     row.SetField("contact_name", entity.contactName);
     row.SetField("addr1", entity.addr1);
     row.SetField("addr2", entity.addr2);
     row.SetField("addr3", entity.addr3);
     row.SetField("city", entity.city);
     row.SetField("state", entity.state);
     row.SetField("zip", entity.zip);
     row.SetField("country", entity.country);
     row.SetField("phone_number", entity.phoneNumber);
     row.SetField("fax_number", entity.faxNumber);
     row.SetField("duns_number", entity.dunsNumber);
     row.SetField("vendaddrrowid", entity.vendaddrrowid.ToByteArray());
     row.SetField("vendorshipfromresultsuserfield", entity.vendorshipfromresultsuserfield);
     row.SetField("userfield", entity.userfield);
 }
예제 #2
0
        public static Vendorshipfromresults BuildVendorshipfromresultsFromRow(DataRow row)
        {
            Vendorshipfromresults entity = new Vendorshipfromresults();

            entity.coNum         = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num");
            entity.whNum         = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num");
            entity.vendorId      = row.IsNull("vendor_id") ? string.Empty : row.Field <string>("vendor_id");
            entity.ediCode       = row.IsNull("edi_code") ? string.Empty : row.Field <string>("edi_code");
            entity.contactName   = row.IsNull("contact_name") ? string.Empty : row.Field <string>("contact_name");
            entity.addr1         = row.IsNull("addr1") ? string.Empty : row.Field <string>("addr1");
            entity.addr2         = row.IsNull("addr2") ? string.Empty : row.Field <string>("addr2");
            entity.addr3         = row.IsNull("addr3") ? string.Empty : row.Field <string>("addr3");
            entity.city          = row.IsNull("city") ? string.Empty : row.Field <string>("city");
            entity.state         = row.IsNull("state") ? string.Empty : row.Field <string>("state");
            entity.zip           = row.IsNull("zip") ? string.Empty : row.Field <string>("zip");
            entity.country       = row.IsNull("country") ? string.Empty : row.Field <string>("country");
            entity.phoneNumber   = row.IsNull("phone_number") ? string.Empty : row.Field <string>("phone_number");
            entity.faxNumber     = row.IsNull("fax_number") ? string.Empty : row.Field <string>("fax_number");
            entity.dunsNumber    = row.IsNull("duns_number") ? string.Empty : row.Field <string>("duns_number");
            entity.vendaddrrowid = row.Field <byte[]>("vendaddrrowid").ToStringEncoded();
            entity.vendorshipfromresultsuserfield = row.IsNull("vendorshipfromresultsuserfield") ? string.Empty : row.Field <string>("vendorshipfromresultsuserfield");
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }