示例#1
0
 public OrdersController(IOrderDAL oDAL, ICustomerDAL cDAL, ILocationDAL lDAL, ILogger <OrdersController> logger)
 {
     _context     = oDAL;
     _custContext = cDAL;
     _locContext  = lDAL;
     this.logger  = logger;
 }
        /// <summary>
        /// 产生打扫人员
        /// </summary>
        /// <returns></returns>
        public OperationResult <bool> ProduceCleaner()
        {
            int count = CountOrderNumber();
            //1.得到随机数
            List <int> random = ProduceRandom(count);

            if (random == null)
            {
                return(new OperationResult <bool>()
                {
                    Message = "今日无人订餐"
                });
            }
            IOrderDAL orderDAL = OrderDALFactory.CreateOrderDAL();
            List <StaffInformationResult> _user = orderDAL.FindByUserOrder();

            if (count <= 4)
            {
                return(new OperationResult <bool>()
                {
                    GetCleanerName1 = _user[random[0]].StaffName, GetCleanerName2 = "", Message = "产生打扫人员"
                });
            }
            else
            {
                return(new OperationResult <bool>()
                {
                    GetCleanerName1 = _user[random[0]].StaffName, GetCleanerName2 = _user[random[1]].StaffName, Message = "产生打扫人员"
                });
            }
        }
示例#3
0
 public Customer(ICustomerDAL customerDAL, IAddToOrderDAL addtoorderDAL, IItemDAL itemDAL, IOrderDAL orderDAL)
 {
     _customerDAL   = customerDAL;
     _addtoorderDAL = addtoorderDAL;
     _itemDAL       = itemDAL;
     _orderDAL      = orderDAL;
 }
示例#4
0
 public OrderManager(IUnitOfWork uow, IHttpContextAccessor httpContextAccessor, IOrderDAL orderDAL, IOrderDetailDAL orderDetailDAL)
 {
     _uow                 = uow;
     _orderDAL            = orderDAL;
     _orderDetailDAL      = orderDetailDAL;
     _httpContextAccessor = httpContextAccessor;
 }
        /// <summary>
        /// 统计人数
        /// </summary>
        /// <returns></returns>
        public int CountOrderNumber()
        {
            IOrderDAL orderDAL = OrderDALFactory.CreateOrderDAL();
            int       count    = orderDAL.CountUserOrder();

            return(count);
        }
 public ServiceContract()
 {
     userDAL = (IUserDAL)ContextRegistry.GetContext().GetObject("UserDAL");
     orderDAL = (IOrderDAL)ContextRegistry.GetContext().GetObject("OrderDAL");
     orderItemDAL = (IOrderItemDAL)ContextRegistry.GetContext().GetObject("OrderItemDAL");
     productDAL = (IProductDAL)ContextRegistry.GetContext().GetObject("ProductDAL");
 }
示例#7
0
 public User(IShipperDAL shipperDAL, IItemDAL itemDAL, ICustomerDAL customerDAL, IOrderDAL orderDAL, IAddToOrderDAL addtoorderDAL)
 {
     _shipperDAL    = shipperDAL;
     _itemDAL       = itemDAL;
     _customerDAL   = customerDAL;
     _orderDAL      = orderDAL;
     _addtoorderDAL = addtoorderDAL;
 }
示例#8
0
        public OrderMgr(IConfiguration config, LocationMgr lm)
        {
            _locMgr         = lm;
            _iconfiguration = config;
            var specifc_DAL = new OrderDAL(_iconfiguration);

            DAL = specifc_DAL;
        }
 public UserDetailController(IUserDAL _userDAL, IUserCardDAL _userCardDAL, IUserAddressDAL _userAddressDAL, ICityDAL _cityDAL, IDistrictDAL _districtDAL, IOrderDAL _orderDAL)
 {
     orderDAL       = _orderDAL;
     districtDAL    = _districtDAL;
     cityDAL        = _cityDAL;
     userDAL        = _userDAL;
     userCardDAL    = _userCardDAL;
     userAddressDAL = _userAddressDAL;
     currentUser    = System.Web.HttpContext.Current.Session["user"] as ETicaret.Model.Models.Entity.User;
 }
        /// <summary>
        /// 得到员工信息
        /// </summary>
        /// <returns></returns>
        public List <StaffInformationResult> GetStaffInformation()
        {
            IOrderDAL orderDAL = OrderDALFactory.CreateOrderDAL();
            List <StaffInformationResult> _user = orderDAL.FindByUserOrder();

            if (_user.Count < 0)
            {
                throw new Exception("程序异常");
            }
            else
            {
                return(_user);
            }
        }
        /// <summary>
        /// 查询订餐的状态
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        public OrderingStateEnum IsOrder(string username)
        {
            IOrderDAL orderDAL   = OrderDALFactory.CreateOrderDAL();
            int       indexcount = orderDAL.OrderingPeople(username).Count();

            if (indexcount > 0)
            {
                return(OrderingStateEnum.IsOrdering);
            }
            else
            {
                return(OrderingStateEnum.IsNullOfOrdering);
            }
        }
        /// <summary>
        /// 根据配置文件中的值创建OrderDAL
        /// </summary>
        /// <returns></returns>
        public static IOrderDAL CreateOrderDAL()
        {
            IOrderDAL orderDAL = null;

            switch (dataBaseType)
            {
            case "SqlServer":
                orderDAL = new OrderSqlServerDAL(); break;

            case "Oracle":
                orderDAL = new OrderOracleDAL(); break;
            }
            return(orderDAL);
        }
示例#13
0
 public OrderController(ICityDAL _cityDAL, IDistrictDAL _districtDAL, IOrderDAL _orderDAL, IUserDAL _userDAL, IUserTypeDAL _userTypeDAL, IProductDAL _productDAL, IUserAddressDAL _userAddressDAL, IUserCardDAL _userCardDAL, IUserDetailDAL _userDetailDAL, IBasketProductDAL _basketProductDAL)
 {
     basketProductDAL = _basketProductDAL;
     userDetailDAL    = _userDetailDAL;
     userCardDAL      = _userCardDAL;
     userAddressDAL   = _userAddressDAL;
     productDAL       = _productDAL;
     userTypeDAL      = _userTypeDAL;
     orderDAL         = _orderDAL;
     cityDAL          = _cityDAL;
     districtDAL      = _districtDAL;
     userDAL          = _userDAL;
     currentUser      = System.Web.HttpContext.Current.Session["user"] as ETicaret.Model.Models.Entity.User;
 }
        public string IsMeno(string username)
        {
            IOrderDAL orderDAL = OrderDALFactory.CreateOrderDAL();
            List <StaffInformationResult> _user = orderDAL.IsAddMeno(username);
            int indexcount = _user.Count();

            if (indexcount > 0)
            {
                return(_user[0].Meno);
            }
            else
            {
                return("");
            }
        }
        /// <summary>
        /// 取消订餐
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        public OperationResult <Boolean> CancelOrder(string userName)
        {
            IOrderDAL orderDAL = OrderDALFactory.CreateOrderDAL();
            int       _user    = orderDAL.DeleteUserOrder(userName);

            if (_user >= 1)
            {
                return(new OperationResult <bool>()
                {
                    Result = true, Message = "取消订餐成功", OrderingState = OrderingStateEnum.IsNullOfOrdering
                });
            }
            else
            {
                return(new OperationResult <bool>()
                {
                    Result = false, Message = "取消订餐失败", OrderingState = OrderingStateEnum.IsNullOfOrdering
                });
            }
        }
        /// <summary>
        /// 订餐
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        public OperationResult <Boolean> ConfirmOrder(string username, string meno)
        {
            IOrderDAL orderDAL = OrderDALFactory.CreateOrderDAL();
            int       _user    = orderDAL.InsertUserOrder(username, meno);

            if (_user >= 1)
            {
                return(new OperationResult <bool>()
                {
                    Result = true, Message = "订餐成功", OrderingState = OrderingStateEnum.IsOrdering
                });
            }
            else
            {
                return(new OperationResult <bool>()
                {
                    Result = false, Message = "订餐失败", OrderingState = OrderingStateEnum.IsNullOfOrdering
                });
            }
        }
示例#17
0
 public OrdersController()
 {
     this.DAL = new OrderDAL();
 }
示例#18
0
 public OrdersController(IOrderDAL DAL)
 {
     this.DAL = DAL;
 }
示例#19
0
 public OrderBLL(IOrderDAL orderDAL)
 {
     _orderDAL = orderDAL;
 }
 public OrderBL()
 {
     orderDAL = new OrderRepository();
 }
示例#21
0
 public OrderManager(IOrderDAL orderDAL) => _orderDAL = orderDAL;
示例#22
0
 public OrderController(IOrderDAL orderdal)
 {
     OrderDAL = orderdal;
 }
示例#23
0
 public OrderService(IOrderDAL orderDAL, ICustomerDAL customerDAL, IEmployeeDAL employeeDAL)
 {
     _orderDAL    = orderDAL;
     _customerDAL = customerDAL;
     _employeeDAL = employeeDAL;
 }
示例#24
0
 public OrderManager(IOrderDAL orderDAL, ILogger <OrderManager> logger)
 {
     _orderDAL   = orderDAL;
     this.logger = logger;
 }
示例#25
0
 public OrderBLL()
 {
     _order = new OrderDAL();
     _product = new ProductDAL();
     _customer = new CustomerDAL();
 }
示例#26
0
 public OrderBLL(IOrderDAL stub)
 {
     _order = stub;
     _product = new ProductDALStub();
     _customer = new CustomerDALStub();
 }
示例#27
0
 public OrderService(IOrderDAL order)
 {
     _order = order;
 }
示例#28
0
 public OrderBLL()
 {
     _orderDAL = new OrderDAL();
     _loggingBLL = new LoggingBLL();
 }
示例#29
0
 public OrderBLL()
     : base(_Type)
 {
     this._Dal = base.CurrentDAL as IOrderDAL;
 }
示例#30
0
 public OrderService(IOrderDAL orderDAL)
 {
     _orderDAL = orderDAL;
 }
示例#31
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="connectionString"></param>
 public static void Initialize(string connectionString)
 {
     OrderDB = new OrderDAL(connectionString);
 }
示例#32
0
 public OrderBLL(IOrderDAL iOrderDAL)
 {
     _orderDAL = iOrderDAL;
     _loggingBLL = new LoggingBLL();
 }
示例#33
0
 public OrderController(IOrderDAL orderDAL)
 {
     db            = new OrderSystemContext();
     this.orderDAL = orderDAL;
 }
示例#34
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="connectionString"></param>
 public static void Initialize(string connectionString)
 {
     OrderDB = new DataLayers.SqlServer.OrderDAL(connectionString);
 }
示例#35
0
 public OrderController()
 {
     db       = new OrderSystemContext();
     orderDAL = new OrderDAL(db);
 }