Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromContactssearchresults(ref DataRow row, Contactssearchresults entity)
 {
     row.SetField("contactid", entity.contactid);
     row.SetField("cono", entity.cono);
     row.SetField("firstnm", entity.firstnm);
     row.SetField("middlenm", entity.middlenm);
     row.SetField("lastnm", entity.lastnm);
     row.SetField("comment", entity.comment);
     row.SetField("contacttype", entity.contacttype);
     row.SetField("contacttypedesc", entity.contacttypedesc);
     row.SetField("cotitle", entity.cotitle);
     row.SetField("groupcd", entity.groupcd);
     row.SetField("priority", entity.priority);
     row.SetField("salutation", entity.salutation);
     row.SetField("dateuser1", entity.dateuser1);
     row.SetField("dateuser2", entity.dateuser2);
     row.SetField("dateuser3", entity.dateuser3);
     row.SetField("dateuser4", entity.dateuser4);
     row.SetField("dateuser5", entity.dateuser5);
     row.SetField("decuser1", entity.decuser1);
     row.SetField("decuser2", entity.decuser2);
     row.SetField("decuser3", entity.decuser3);
     row.SetField("decuser4", entity.decuser4);
     row.SetField("decuser5", entity.decuser5);
     row.SetField("intuser1", entity.intuser1);
     row.SetField("intuser2", entity.intuser2);
     row.SetField("intuser3", entity.intuser3);
     row.SetField("intuser4", entity.intuser4);
     row.SetField("intuser5", entity.intuser5);
     row.SetField("charuser1", entity.charuser1);
     row.SetField("charuser2", entity.charuser2);
     row.SetField("charuser3", entity.charuser3);
     row.SetField("charuser4", entity.charuser4);
     row.SetField("charuser5", entity.charuser5);
     row.SetField("charuser6", entity.charuser6);
     row.SetField("charuser7", entity.charuser7);
     row.SetField("charuser8", entity.charuser8);
     row.SetField("charuser9", entity.charuser9);
     row.SetField("charuser10", entity.charuser10);
     row.SetField("loguser1", entity.loguser1);
     row.SetField("loguser2", entity.loguser2);
     row.SetField("loguser3", entity.loguser3);
     row.SetField("loguser4", entity.loguser4);
     row.SetField("loguser5", entity.loguser5);
     row.SetField("firstroletype", entity.firstroletype);
     row.SetField("firstprimarykey", entity.firstprimarykey);
     row.SetField("firstsecondarykey", entity.firstsecondarykey);
     row.SetField("firstname", entity.firstname);
     row.SetField("secondroletype", entity.secondroletype);
     row.SetField("secondprimarykey", entity.secondprimarykey);
     row.SetField("secondsecondarykey", entity.secondsecondarykey);
     row.SetField("secondname", entity.secondname);
     row.SetField("firstphoneno", entity.firstphoneno);
     row.SetField("firstphonenodesc", entity.firstphonenodesc);
     row.SetField("secondphoneno", entity.secondphoneno);
     row.SetField("secondphonenodesc", entity.secondphonenodesc);
     row.SetField("thirdphoneno", entity.thirdphoneno);
     row.SetField("thirdphonenodesc", entity.thirdphonenodesc);
     row.SetField("faxphoneno", entity.faxphoneno);
     row.SetField("firstemailaddr", entity.firstemailaddr);
     row.SetField("firstemailaddrdesc", entity.firstemailaddrdesc);
     row.SetField("secondemailaddr", entity.secondemailaddr);
     row.SetField("secondemailaddrdesc", entity.secondemailaddrdesc);
     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("notesdata", entity.notesdata);
     row.SetField("sortfield", entity.sortfield);
 }
Пример #2
0
        public static Contactssearchresults BuildContactssearchresultsFromRow(DataRow row)
        {
            Contactssearchresults entity = new Contactssearchresults();

            entity.contactid           = row.IsNull("contactid") ? decimal.Zero : row.Field <decimal>("contactid");
            entity.cono                = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.firstnm             = row.IsNull("firstnm") ? string.Empty : row.Field <string>("firstnm");
            entity.middlenm            = row.IsNull("middlenm") ? string.Empty : row.Field <string>("middlenm");
            entity.lastnm              = row.IsNull("lastnm") ? string.Empty : row.Field <string>("lastnm");
            entity.comment             = row.IsNull("comment") ? string.Empty : row.Field <string>("comment");
            entity.contacttype         = row.IsNull("contacttype") ? string.Empty : row.Field <string>("contacttype");
            entity.contacttypedesc     = row.IsNull("contacttypedesc") ? string.Empty : row.Field <string>("contacttypedesc");
            entity.cotitle             = row.IsNull("cotitle") ? string.Empty : row.Field <string>("cotitle");
            entity.groupcd             = row.IsNull("groupcd") ? string.Empty : row.Field <string>("groupcd");
            entity.priority            = row.IsNull("priority") ? 0 : row.Field <int>("priority");
            entity.salutation          = row.IsNull("salutation") ? string.Empty : row.Field <string>("salutation");
            entity.dateuser1           = row.Field <DateTime?>("dateuser1");
            entity.dateuser2           = row.Field <DateTime?>("dateuser2");
            entity.dateuser3           = row.Field <DateTime?>("dateuser3");
            entity.dateuser4           = row.Field <DateTime?>("dateuser4");
            entity.dateuser5           = row.Field <DateTime?>("dateuser5");
            entity.decuser1            = row.IsNull("decuser1") ? decimal.Zero : row.Field <decimal>("decuser1");
            entity.decuser2            = row.IsNull("decuser2") ? decimal.Zero : row.Field <decimal>("decuser2");
            entity.decuser3            = row.IsNull("decuser3") ? decimal.Zero : row.Field <decimal>("decuser3");
            entity.decuser4            = row.IsNull("decuser4") ? decimal.Zero : row.Field <decimal>("decuser4");
            entity.decuser5            = row.IsNull("decuser5") ? decimal.Zero : row.Field <decimal>("decuser5");
            entity.intuser1            = row.IsNull("intuser1") ? 0 : row.Field <int>("intuser1");
            entity.intuser2            = row.IsNull("intuser2") ? 0 : row.Field <int>("intuser2");
            entity.intuser3            = row.IsNull("intuser3") ? 0 : row.Field <int>("intuser3");
            entity.intuser4            = row.IsNull("intuser4") ? 0 : row.Field <int>("intuser4");
            entity.intuser5            = row.IsNull("intuser5") ? 0 : row.Field <int>("intuser5");
            entity.charuser1           = row.IsNull("charuser1") ? string.Empty : row.Field <string>("charuser1");
            entity.charuser2           = row.IsNull("charuser2") ? string.Empty : row.Field <string>("charuser2");
            entity.charuser3           = row.IsNull("charuser3") ? string.Empty : row.Field <string>("charuser3");
            entity.charuser4           = row.IsNull("charuser4") ? string.Empty : row.Field <string>("charuser4");
            entity.charuser5           = row.IsNull("charuser5") ? string.Empty : row.Field <string>("charuser5");
            entity.charuser6           = row.IsNull("charuser6") ? string.Empty : row.Field <string>("charuser6");
            entity.charuser7           = row.IsNull("charuser7") ? string.Empty : row.Field <string>("charuser7");
            entity.charuser8           = row.IsNull("charuser8") ? string.Empty : row.Field <string>("charuser8");
            entity.charuser9           = row.IsNull("charuser9") ? string.Empty : row.Field <string>("charuser9");
            entity.charuser10          = row.IsNull("charuser10") ? string.Empty : row.Field <string>("charuser10");
            entity.loguser1            = row.Field <bool>("loguser1");
            entity.loguser2            = row.Field <bool>("loguser2");
            entity.loguser3            = row.Field <bool>("loguser3");
            entity.loguser4            = row.Field <bool>("loguser4");
            entity.loguser5            = row.Field <bool>("loguser5");
            entity.firstroletype       = row.IsNull("firstroletype") ? string.Empty : row.Field <string>("firstroletype");
            entity.firstprimarykey     = row.IsNull("firstprimarykey") ? string.Empty : row.Field <string>("firstprimarykey");
            entity.firstsecondarykey   = row.IsNull("firstsecondarykey") ? string.Empty : row.Field <string>("firstsecondarykey");
            entity.firstname           = row.IsNull("firstname") ? string.Empty : row.Field <string>("firstname");
            entity.secondroletype      = row.IsNull("secondroletype") ? string.Empty : row.Field <string>("secondroletype");
            entity.secondprimarykey    = row.IsNull("secondprimarykey") ? string.Empty : row.Field <string>("secondprimarykey");
            entity.secondsecondarykey  = row.IsNull("secondsecondarykey") ? string.Empty : row.Field <string>("secondsecondarykey");
            entity.secondname          = row.IsNull("secondname") ? string.Empty : row.Field <string>("secondname");
            entity.firstphoneno        = row.IsNull("firstphoneno") ? string.Empty : row.Field <string>("firstphoneno");
            entity.firstphonenodesc    = row.IsNull("firstphonenodesc") ? string.Empty : row.Field <string>("firstphonenodesc");
            entity.secondphoneno       = row.IsNull("secondphoneno") ? string.Empty : row.Field <string>("secondphoneno");
            entity.secondphonenodesc   = row.IsNull("secondphonenodesc") ? string.Empty : row.Field <string>("secondphonenodesc");
            entity.thirdphoneno        = row.IsNull("thirdphoneno") ? string.Empty : row.Field <string>("thirdphoneno");
            entity.thirdphonenodesc    = row.IsNull("thirdphonenodesc") ? string.Empty : row.Field <string>("thirdphonenodesc");
            entity.faxphoneno          = row.IsNull("faxphoneno") ? string.Empty : row.Field <string>("faxphoneno");
            entity.firstemailaddr      = row.IsNull("firstemailaddr") ? string.Empty : row.Field <string>("firstemailaddr");
            entity.firstemailaddrdesc  = row.IsNull("firstemailaddrdesc") ? string.Empty : row.Field <string>("firstemailaddrdesc");
            entity.secondemailaddr     = row.IsNull("secondemailaddr") ? string.Empty : row.Field <string>("secondemailaddr");
            entity.secondemailaddrdesc = row.IsNull("secondemailaddrdesc") ? string.Empty : row.Field <string>("secondemailaddrdesc");
            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.notesdata           = row.IsNull("notesdata") ? string.Empty : row.Field <string>("notesdata");
            entity.sortfield           = row.IsNull("sortfield") ? string.Empty : row.Field <string>("sortfield");
            return(entity);
        }