Esempio n. 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 = "产生打扫人员"
                });
            }
        }
Esempio n. 3
0
 public Customer(ICustomerDAL customerDAL, IAddToOrderDAL addtoorderDAL, IItemDAL itemDAL, IOrderDAL orderDAL)
 {
     _customerDAL   = customerDAL;
     _addtoorderDAL = addtoorderDAL;
     _itemDAL       = itemDAL;
     _orderDAL      = orderDAL;
 }
Esempio n. 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");
 }
Esempio n. 7
0
 public User(IShipperDAL shipperDAL, IItemDAL itemDAL, ICustomerDAL customerDAL, IOrderDAL orderDAL, IAddToOrderDAL addtoorderDAL)
 {
     _shipperDAL    = shipperDAL;
     _itemDAL       = itemDAL;
     _customerDAL   = customerDAL;
     _orderDAL      = orderDAL;
     _addtoorderDAL = addtoorderDAL;
 }
Esempio n. 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);
        }
Esempio n. 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
                });
            }
        }
Esempio n. 17
0
 public OrdersController()
 {
     this.DAL = new OrderDAL();
 }
Esempio n. 18
0
 public OrdersController(IOrderDAL DAL)
 {
     this.DAL = DAL;
 }
Esempio n. 19
0
 public OrderBLL(IOrderDAL orderDAL)
 {
     _orderDAL = orderDAL;
 }
 public OrderBL()
 {
     orderDAL = new OrderRepository();
 }
Esempio n. 21
0
 public OrderManager(IOrderDAL orderDAL) => _orderDAL = orderDAL;
Esempio n. 22
0
 public OrderController(IOrderDAL orderdal)
 {
     OrderDAL = orderdal;
 }
Esempio n. 23
0
 public OrderService(IOrderDAL orderDAL, ICustomerDAL customerDAL, IEmployeeDAL employeeDAL)
 {
     _orderDAL    = orderDAL;
     _customerDAL = customerDAL;
     _employeeDAL = employeeDAL;
 }
Esempio n. 24
0
 public OrderManager(IOrderDAL orderDAL, ILogger <OrderManager> logger)
 {
     _orderDAL   = orderDAL;
     this.logger = logger;
 }
Esempio n. 25
0
 public OrderBLL()
 {
     _order = new OrderDAL();
     _product = new ProductDAL();
     _customer = new CustomerDAL();
 }
Esempio n. 26
0
 public OrderBLL(IOrderDAL stub)
 {
     _order = stub;
     _product = new ProductDALStub();
     _customer = new CustomerDALStub();
 }
Esempio n. 27
0
 public OrderService(IOrderDAL order)
 {
     _order = order;
 }
Esempio n. 28
0
 public OrderBLL()
 {
     _orderDAL = new OrderDAL();
     _loggingBLL = new LoggingBLL();
 }
Esempio n. 29
0
 public OrderBLL()
     : base(_Type)
 {
     this._Dal = base.CurrentDAL as IOrderDAL;
 }
Esempio n. 30
0
 public OrderService(IOrderDAL orderDAL)
 {
     _orderDAL = orderDAL;
 }
Esempio n. 31
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="connectionString"></param>
 public static void Initialize(string connectionString)
 {
     OrderDB = new OrderDAL(connectionString);
 }
Esempio n. 32
0
 public OrderBLL(IOrderDAL iOrderDAL)
 {
     _orderDAL = iOrderDAL;
     _loggingBLL = new LoggingBLL();
 }
Esempio n. 33
0
 public OrderController(IOrderDAL orderDAL)
 {
     db            = new OrderSystemContext();
     this.orderDAL = orderDAL;
 }
Esempio n. 34
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="connectionString"></param>
 public static void Initialize(string connectionString)
 {
     OrderDB = new DataLayers.SqlServer.OrderDAL(connectionString);
 }
Esempio n. 35
0
 public OrderController()
 {
     db       = new OrderSystemContext();
     orderDAL = new OrderDAL(db);
 }