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

            entity.contactid        = row.IsNull("contactid") ? decimal.Zero : row.Field <decimal>("contactid");
            entity.methodkey        = row.IsNull("methodkey") ? string.Empty : row.Field <string>("methodkey");
            entity.methodtype       = row.IsNull("methodtype") ? string.Empty : row.Field <string>("methodtype");
            entity.methoddesc       = row.IsNull("methoddesc") ? string.Empty : row.Field <string>("methoddesc");
            entity.primaryfl        = row.Field <bool>("primaryfl");
            entity.cvalue           = row.IsNull("cvalue") ? string.Empty : row.Field <string>("cvalue");
            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.zipcd            = row.IsNull("zipcd") ? string.Empty : row.Field <string>("zipcd");
            entity.countrycd        = row.IsNull("countrycd") ? string.Empty : row.Field <string>("countrycd");
            entity.countrydesc      = row.IsNull("countrydesc") ? string.Empty : row.Field <string>("countrydesc");
            entity.descrip          = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip");
            entity.shipmentnoticefl = row.Field <bool>("shipmentnoticefl");
            entity.others           = row.IsNull("others") ? string.Empty : row.Field <string>("others");
            entity.metRowid         = row.Field <byte[]>("met-rowid").ToStringEncoded();
            entity.delFlag          = row.Field <bool>("del-flag");
            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 UpdateRowFromCamcontactmethods(ref DataRow row, Camcontactmethods entity)
 {
     row.SetField("contactid", entity.contactid);
     row.SetField("methodkey", entity.methodkey);
     row.SetField("methodtype", entity.methodtype);
     row.SetField("methoddesc", entity.methoddesc);
     row.SetField("primaryfl", entity.primaryfl);
     row.SetField("cvalue", entity.cvalue);
     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("zipcd", entity.zipcd);
     row.SetField("countrycd", entity.countrycd);
     row.SetField("countrydesc", entity.countrydesc);
     row.SetField("descrip", entity.descrip);
     row.SetField("shipmentnoticefl", entity.shipmentnoticefl);
     row.SetField("others", entity.others);
     row.SetField("met-rowid", entity.metRowid.ToByteArray());
     row.SetField("del-flag", entity.delFlag);
     row.SetField("userfield", entity.userfield);
 }