Ejemplo n.º 1
0
        public AjaxMessage GetLoseContent(string CustomerId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "系统异常,请稍候再试...";
            try
            {
                if (!string.IsNullOrEmpty(CustomerId))
                {
                    FL_OrderDetails m_details = _orderService.GetLoseOrder(new Guid(CustomerId));

                    ajax.IsSuccess = true;
                    ajax.Message   = m_details.OrderContent;
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message.ToString();
            }

            return(ajax);
        }
Ejemplo n.º 2
0
        public AjaxMessage OrderCotentCreate(FL_OrderDetails orderDetail)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "异常错误,请稍后再试...";

            try
            {               //暂不考虑成功预定
                int  employeeId = LoginInfo.UserInfo.EmployeeId;
                Guid CustomerId = new Guid(orderDetail.CustomerId.ToString());

                //客户详情
                FL_Customer m_customer = _customerService.GetByGuid(CustomerId);
                m_customer.State = orderDetail.OrderState;

                //订单信息
                FL_Order m_order = _orderService.GetByGuid(new Guid(orderDetail.OrderId.ToString()));
                m_order.OrderState = m_customer.State;
                m_order.FollowCount++;
                if (orderDetail.OrderState != 9)
                {
                    m_order.NextFollowDate = orderDetail.NextFollowDate;
                }
                m_order.LastFollowDate = DateTime.Now;



                //订单详情
                orderDetail.EmployeeId = employeeId;
                orderDetail.CreateDate = DateTime.Now;



                //统计信息
                SS_Report m_report = _reportService.GetByCustomerId(CustomerId);
                m_report.CustomerState = m_customer.State;


                //事务
                using (TransactionScope scope = new TransactionScope())
                {
                    //修改客户表
                    _customerService.Update(m_customer);

                    //订单详情
                    _detailsService.Add(orderDetail);

                    //修改订单表
                    _orderService.Update(m_order);

                    //修改统计表
                    _reportService.Update(m_report);

                    scope.Complete();
                }

                ajax.IsSuccess = true;
                ajax.Message   = "记录成功";
            }
            catch (Exception e)
            {
                ajax.Message = e.Message.ToString();
            }

            return(ajax);
        }