Exemple #1
0
        /// <summary>
        ///  Map a DataRow to a UserDashlet Entity.
        /// </summary>
        /// <returns></returns>
        public static UserDashlet Row2Entity(System.Data.DataRow row)
        {
            if (row == null)
            {
                return(null);
            }

            UserDashlet entity = new UserDashlet();

            entity._userId     = Cast.Int(row["USR_ID"]);
            entity._dashpageId = Cast.Int(row["DP_ID"]);
            entity._dashletId  = Cast.Int(row["DL_ID"]);
            entity._status     = Cast.Enum <DashStatus>(row["UDL_STATUS"]);

            return(entity);
        }
Exemple #2
0
        /// <summary>
        ///  Map a DataTable's Rows to a List of UserDashlet Entity.
        /// </summary>
        /// <returns></returns>
        public static IList <UserDashlet> Row2Entity(System.Data.DataTable dt)
        {
            IList <UserDashlet> list = null;

            if (dt != null && dt.Rows.Count > 0)
            {
                list = new List <UserDashlet>(dt.Rows.Count);
                foreach (System.Data.DataRow row in dt.Rows)
                {
                    UserDashlet entity = Row2Entity(row);
                    if (entity != null)
                    {
                        list.Add(entity);
                    }
                }
            }
            return(list);
        }
        /// <summary>
        ///  Map a DataRow to a UserDashlet Entity.
        /// </summary>
        /// <returns></returns>
        public static UserDashlet Row2Entity(System.Data.DataRow row)
        {
            if(row == null) return null;

            UserDashlet entity = new UserDashlet();

            entity._userId= Cast.Int(row["USR_ID"]);
            entity._dashpageId= Cast.Int(row["DP_ID"]);
            entity._dashletId= Cast.Int(row["DL_ID"]);
            entity._status= Cast.Enum<DashStatus>(row["UDL_STATUS"]);

               return entity;
        }