Esempio n. 1
0
        public CommonRtnEntity Add([FromBody] OrderInfo info)
        {
            IOrderServices services = new OrderServices();

            int result = 0;

            //编辑
            if (info.ID > 0)
            {
                OrderInfo oldOrderInfo = services.QueryByID(info.ID);
                info.UpdateTime = DateTime.Now;
                services.Update(info);
                result = info.ID;
            }
            else
            {
                result = services.Add(info);
            }

            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = result > 0,
                Data    = result,
                Message = result > 0 ? "成功" : "失败"
            };

            return(rtnInfo);
        }
        // Adds the bound service model to the List

        public void AddService(double service_Cost, string service_Description)
        {
            OrderServices.Add(new ServiceModel {
                Description = service_Description, Cost = service_Cost
            });
            NotifyOfPropertyChange(() => OrderServices);
            NotifyOfPropertyChange(() => CanExportPdf);
            NotifyOfPropertyChange(() => CanAddOrder);
        }
Esempio n. 3
0
 public void AddService(OrderService order)
 {
     OrderServices.Add(order);
 }