Exemplo n.º 1
0
 /// <summary>
 /// 遍历普通枚举
 /// </summary>
 /// <returns></returns>
 public static void ForEachEnum()
 {
     foreach (string Type in Enum.GetNames(typeof(shopInfo)))
     {
         shopInfo type      = (shopInfo)Enum.Parse(typeof(shopInfo), Type);
         string   Key       = type.ToString();
         string   EnumValue = type.GetHashCode().ToString();
     }
 }
Exemplo n.º 2
0
        private static shopInfo ConvertFromDto(HotelInfoDto hotelDto)
        {
            if (hotelDto == null)
            {
                return(null);
            }
            shopInfo user = new shopInfo()
            {
                Shop_Address  = hotelDto.HAddress,
                Shop_chuanzen = hotelDto.HFax,
                id            = hotelDto.HID,
                Shop_x        = hotelDto.HLocationX.ToString(),
                Shop_y        = hotelDto.HLocationY.ToString(),
                shop_Name     = hotelDto.HName,
                Shop_Telphone = hotelDto.HPhone,
                Shop_Remaker  = hotelDto.Remark,
                Shop_date     = hotelDto.CreateTime
            };

            return(user);
        }
Exemplo n.º 3
0
        private static HotelInfoDto ConvertFromBllEntity(shopInfo shop)
        {
            if (shop == null)
            {
                return(null);
            }
            HotelInfoDto accountDto = new HotelInfoDto()
            {
                HAddress   = shop.Shop_Address,
                HFax       = shop.Shop_chuanzen,
                HID        = shop.id,
                HLocationX = float.Parse(shop.Shop_x),
                HLocationY = float.Parse(shop.Shop_y),
                HName      = shop.shop_Name,
                HPhone     = shop.Shop_Telphone,
                Remark     = shop.Shop_Remaker,
                CreateTime = shop.Shop_date.Value
            };

            return(accountDto);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 根据枚举Key 获取枚举的序号
 /// </summary>
 /// <returns></returns>
 public static void ForEachEnum(shopInfo parm)
 {
     shopInfo type      = parm;
     string   Key       = type.ToString();
     string   EnumValue = type.GetHashCode().ToString();
 }