コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="positionInfoViews"></param>
        /// <returns></returns>
        public static IList <PositionInfoDto> PositionViewToPositionInfo(IList <PositionInfoView> positionInfoViews)
        {
            IList <PositionInfoDto> positionInfoDtos = new List <PositionInfoDto>();

            foreach (PositionInfoView positionInfoView in positionInfoViews)
            {
                PositionInfoDto positionInfoDto = AutoMapperExtensions.MapTo <PositionInfoDto>(positionInfoView);
                positionInfoDto.Roles = SerializationUtility.JsonToObject <IList <AbstractDto> >(positionInfoView.Roles);
                positionInfoDtos.Add(positionInfoDto);
            }
            return(positionInfoDtos);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="jsons"></param>
        /// <returns></returns>
        public List <SystemJsonItem> ToSystemJsonItems(IList <string> jsons)
        {
            if (jsons == null)
            {
                return(null);
            }
            List <SystemJsonItem> jsonItems = new List <SystemJsonItem>();

            foreach (string json in jsons)
            {
                if (json != null)
                {
                    var r = SerializationUtility.JsonToObject <List <SystemJsonItem> >(json);
                    if (r != null)
                    {
                        jsonItems.AddRange(r);
                    }
                }
            }
            return(jsonItems);
        }
コード例 #3
0
        private string GetUnitCode()
        {
            UserSessionInfo session = IocUnity.Get <SessionManager>().GetSessionByRequest(Request);

            return(SerializationUtility.JsonToObject <IList <UserPositionDto> >(session.GetExtionValue("OrganizationIds"))[0].OrganizationCode);
        }