Esempio n. 1
0
        public override IModel CreateModel(DataRow dr)
        {
            RoleDeptMenu roledeptmenu = new RoleDeptMenu();

            roledeptmenu.RoleDeptMenuID = Convert.ToInt32(dr["RoleDeptMenuID"]);

            if (dr["RoleDeptId"] != DBNull.Value)
            {
                roledeptmenu.RoleDeptId = Convert.ToInt32(dr["RoleDeptId"]);
            }

            if (dr["MenuId"] != DBNull.Value)
            {
                roledeptmenu.MenuId = Convert.ToInt32(dr["MenuId"]);
            }

            if (dr["RefStatus"] != DBNull.Value)
            {
                roledeptmenu.RefStatus = (Common.StatusEnum)Convert.ToInt32(dr["RefStatus"]);
            }

            if (dr["CreatorId"] != DBNull.Value)
            {
                roledeptmenu.CreatorId = Convert.ToInt32(dr["CreatorId"]);
            }

            if (dr["CreateTime"] != DBNull.Value)
            {
                roledeptmenu.CreateTime = Convert.ToDateTime(dr["CreateTime"]);
            }

            if (dr["LastModifyId"] != DBNull.Value)
            {
                roledeptmenu.LastModifyId = Convert.ToInt32(dr["LastModifyId"]);
            }

            if (dr["LastModifyTime"] != DBNull.Value)
            {
                roledeptmenu.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            }

            return roledeptmenu;
        }
Esempio n. 2
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            RoleDeptMenu roledeptmenu = new RoleDeptMenu();

            int indexRoleDeptMenuID = dr.GetOrdinal("RoleDeptMenuID");
            roledeptmenu.RoleDeptMenuID = Convert.ToInt32(dr[indexRoleDeptMenuID]);

            int indexRoleDeptId = dr.GetOrdinal("RoleDeptId");
            if (dr["RoleDeptId"] != DBNull.Value)
            {
                roledeptmenu.RoleDeptId = Convert.ToInt32(dr[indexRoleDeptId]);
            }

            int indexMenuId = dr.GetOrdinal("MenuId");
            if (dr["MenuId"] != DBNull.Value)
            {
                roledeptmenu.MenuId = Convert.ToInt32(dr[indexMenuId]);
            }

            int indexRefStatus = dr.GetOrdinal("RefStatus");
            if (dr["RefStatus"] != DBNull.Value)
            {
                roledeptmenu.RefStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexRefStatus]);
            }

            int indexCreatorId = dr.GetOrdinal("CreatorId");
            if (dr["CreatorId"] != DBNull.Value)
            {
                roledeptmenu.CreatorId = Convert.ToInt32(dr[indexCreatorId]);
            }

            int indexCreateTime = dr.GetOrdinal("CreateTime");
            if (dr["CreateTime"] != DBNull.Value)
            {
                roledeptmenu.CreateTime = Convert.ToDateTime(dr[indexCreateTime]);
            }

            int indexLastModifyId = dr.GetOrdinal("LastModifyId");
            if (dr["LastModifyId"] != DBNull.Value)
            {
                roledeptmenu.LastModifyId = Convert.ToInt32(dr[indexLastModifyId]);
            }

            int indexLastModifyTime = dr.GetOrdinal("LastModifyTime");
            if (dr["LastModifyTime"] != DBNull.Value)
            {
                roledeptmenu.LastModifyTime = Convert.ToDateTime(dr[indexLastModifyTime]);
            }

            return roledeptmenu;
        }