Exemplo n.º 1
0
        public static Camcontactsearchlist BuildCamcontactsearchlistFromRow(DataRow row)
        {
            Camcontactsearchlist entity = new Camcontactsearchlist();

            entity.contactid       = row.IsNull("contactid") ? decimal.Zero : row.Field <decimal>("contactid");
            entity.firstnm         = row.IsNull("firstnm") ? string.Empty : row.Field <string>("firstnm");
            entity.lastnm          = row.IsNull("lastnm") ? string.Empty : row.Field <string>("lastnm");
            entity.priority        = row.IsNull("priority") ? 0 : row.Field <int>("priority");
            entity.comment         = row.IsNull("comment") ? string.Empty : row.Field <string>("comment");
            entity.cotitle         = row.IsNull("cotitle") ? string.Empty : row.Field <string>("cotitle");
            entity.contacttypedesc = row.IsNull("contacttypedesc") ? string.Empty : row.Field <string>("contacttypedesc");
            entity.langcd          = row.IsNull("langcd") ? string.Empty : row.Field <string>("langcd");
            entity.notesfl         = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl");
            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.subjectinfo     = row.IsNull("subjectinfo") ? string.Empty : row.Field <string>("subjectinfo");
            entity.name            = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.contactsrecid   = row.IsNull("contactsrecid") ? 0 : row.Field <long>("contactsrecid");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromCamcontactsearchlist(ref DataRow row, Camcontactsearchlist entity)
 {
     row.SetField("contactid", entity.contactid);
     row.SetField("firstnm", entity.firstnm);
     row.SetField("lastnm", entity.lastnm);
     row.SetField("priority", entity.priority);
     row.SetField("comment", entity.comment);
     row.SetField("cotitle", entity.cotitle);
     row.SetField("contacttypedesc", entity.contacttypedesc);
     row.SetField("langcd", entity.langcd);
     row.SetField("notesfl", entity.notesfl);
     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("subjectinfo", entity.subjectinfo);
     row.SetField("name", entity.name);
     row.SetField("contactsrecid", entity.contactsrecid);
     row.SetField("userfield", entity.userfield);
 }