Esempio n. 1
0
        private DalOrderType ToDalOrder(ServiceOrderType type)
        {
            switch (type)
            {
            case ServiceOrderType.Likes:
                return(DalOrderType.Likes);

            case ServiceOrderType.Comments:
                return(DalOrderType.Comments);

            case ServiceOrderType.Reads:
                return(DalOrderType.Reads);
            }
            return(DalOrderType.Likes);
        }
        private ServiceOrder GenerateServiceOrder(ServiceOrderType type, int PublicPlaceId)
        {
            ServiceOrder order = new ServiceOrder();

            order.OrderDate = DateTime.Now;
            order.Type      = type;

            PublicPlace place = _publicPlaceRepository.GetPublicPlace(PublicPlaceId);

            if (place == null)
            {
                throw new CityServiceException(500, "Parametro 'logradouro' inválido");
            }

            order.Place = place;

            return(order);
        }
Esempio n. 3
0
        protected void OnButtonOkClicked(object sender, EventArgs e)
        {
            service.Name = entryName.Text;
            if (service.ListServiceOrderType.Count < 1)
            {
                ServiceOrderType serOrderType = new ServiceOrderType(service, (OrderTypeClass)comboboxOrderType.SelectedItem);
                service.ListServiceOrderType.Add(serOrderType);
            }
            else
            {
                service.ListServiceOrderType[0].OrderTypeClass = (OrderTypeClass)comboboxOrderType.SelectedItem;
                service.ListServiceOrderType[0].Service        = service;
            }
            service.Price = decimal.Parse(spinPrice.Value.ToString());

            UoW.Save(service);
            UoW.Commit();
            logger.Info("Ok");

            Respond(ResponseType.Ok);
        }
Esempio n. 4
0
 public IEnumerable <ServiceBook> OrderTake(ServiceOrderType filter, int offset, int count)
 {
     return(unit.Books.OrderTake(ToDalOrder(filter), offset, count).Select(e => e.ToServiceBook()));
 }