Пример #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromUserlist(ref DataRow row, Userlist entity)
 {
     row.SetField("cono", entity.cono);
     row.SetField("oper2", entity.oper2);
     row.SetField("username", entity.username);
     row.SetField("dept", entity.dept);
     row.SetField("workphone", entity.workphone);
     row.SetField("loginnm", entity.loginnm);
     row.SetField("userfield", entity.userfield);
 }
Пример #2
0
        public static Userlist BuildUserlistFromRow(DataRow row)
        {
            Userlist entity = new Userlist();

            entity.cono      = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.oper2     = row.IsNull("oper2") ? string.Empty : row.Field <string>("oper2");
            entity.username  = row.IsNull("username") ? string.Empty : row.Field <string>("username");
            entity.dept      = row.IsNull("dept") ? string.Empty : row.Field <string>("dept");
            entity.workphone = row.IsNull("workphone") ? string.Empty : row.Field <string>("workphone");
            entity.loginnm   = row.IsNull("loginnm") ? string.Empty : row.Field <string>("loginnm");
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }