Exemplo n.º 1
0
        public ActionResult Lend()  //ödünç verme
        {
            List <SelectListItem> deger1 = (from i in _memberService.GetAll()
                                            select new SelectListItem
            {
                Text = i.Name + " " + i.LastName,
                Value = i.Id.ToString()
            }).ToList();

            ViewBag.dgr1 = deger1;
            List <SelectListItem> deger2 = (from i in _bookService.GetByStatusTrue()
                                            select new SelectListItem
            {
                Text = i.Name,
                Value = i.Id.ToString()
            }).ToList();

            ViewBag.dgr2 = deger2;
            List <SelectListItem> deger3 = (from i in _staffService.GetAll()
                                            select new SelectListItem
            {
                Text = i.StaffName,
                Value = i.Id.ToString()
            }).ToList();

            ViewBag.dgr3 = deger3;
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Create()
        {
            ViewBag.CinemaStatus = new SelectList(_statusService.GetAll(), "StatusID", "StatusName");
            List <Staff> listStaff = (List <Staff>)_staffService.GetAll().Where(x => x.StaffStatus == "AC").ToList();


            ViewBag.CinemaManagerID = new SelectList(_staffService.GetAll(), "StaffID", "StaffCode");
            return(View());
        }
Exemplo n.º 3
0
 public void BindStaffDropdown()
 {
     ViewBag.StaffList = _staffService.GetAll(x => x.IsActive == true).Select(x => new SelectListItem
     {
         Text  = _userService.GetById(x.UserId).FullName,
         Value = x.Id.ToString()
     }).OrderBy(x => x.Text).ToList();
 }
Exemplo n.º 4
0
        public ActionResult StaffIndex()
        {
            IStaffService service = IoC.Resolve <IStaffService>();
            var           list    = service.GetAll();
            //var a = service.Getbygender("");
            StaffIndex model = new StaffIndex();

            model.ListStaff = list;
            return(View(model));
        }
        public IActionResult GetAll()
        {
            var result = staffManager.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 6
0
        // GET: Staff
        public ActionResult Index()
        {
            //var employees = _staffService.Include(e => e.Location).Include(e => e.Position);

            var employees = _staffService.GetAll();
            var locations = _locationService.GetAll();
            var positions = _positionService.GetAll();

            return(View(employees.ToList()));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var staff = await _staffService.GetAll();

                return(Ok(staff));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(StatusCode(409));
            }
        }
Exemplo n.º 8
0
        public void GetLiveStaffs()
        {
            var criteria = new SearchCriteria <StaffDTO>();

            var stafType = (StaffTypes)SelectedStaffTypeForFilter.Value;

            if (stafType != StaffTypes.All)
            {
                criteria.FiList.Add(b => b.Type == stafType);
            }

            StaffList = _staffService.GetAll(criteria).OrderBy(i => i.Id).ToList();

            Staffs = new ObservableCollection <StaffDTO>(StaffList);
        }
Exemplo n.º 9
0
        public IHttpActionResult Getstaffs()
        {
            ResponseDataDTO <IEnumerable <staff> > response = new ResponseDataDTO <IEnumerable <staff> >();

            try
            {
                response.Code    = HttpCode.OK;
                response.Message = MessageResponse.SUCCESS;
                response.Data    = _staffservice.GetAll();
            }
            catch (Exception ex)
            {
                response.Code    = HttpCode.INTERNAL_SERVER_ERROR;
                response.Message = ex.Message;
                response.Data    = null;

                Console.WriteLine(ex.ToString());
            }

            return(Ok(response));
        }
Exemplo n.º 10
0
        public IActionResult GetAll()
        {
            var staffs = _staffService.GetAll();

            return(Ok(staffs));
        }
Exemplo n.º 11
0
 public async Task <dynamic> GetStaff()
 {
     return(await _staffService.GetAll());
 }
Exemplo n.º 12
0
 public Task <ActionResult <List <Staff> > > GetAll()
 {
     return(WrapRequestAsync(() => _staffService.GetAll()));
 }
Exemplo n.º 13
0
 public IActionResult Get()
 {
     return(Ok(staffService.GetAll()));
 }
Exemplo n.º 14
0
        // GET: Staff
        public ActionResult Index()
        {
            var value = _staffManager.GetAll();

            return(View(value));
        }
Exemplo n.º 15
0
 public async Task <List <Staff> > GetAllStaffAsync(bool isactive)
 {
     return(await service.GetAll(isactive));
 }
        public ActionResult Create(int id)
        {
            isAdminLogged();
            ViewBag.Parent = "Quản lý giao hàng";
            ViewBag.Child  = "Lập đơn giao hàng";
            // kt nếu đơn đặt hàng đã lập đơn giao rồi thì thông báo, điều hướng đến trang chi tiết giao hàng
            var order     = _orderService.GetOrder(id);
            var firdOrder = order.DeliveryOrders.FirstOrDefault();

            if (firdOrder != null)
            {
                return(RedirectToAction("Details", new { id = firdOrder.idDeliveryOrder }));
            }
            else
            {
                var contractList = order.Distributor.Contracts.ToList();
                var nowContract  = contractList.OrderByDescending(i => i.expiredDate).FirstOrDefault();
                var commission   = 0;
                if (nowContract.status == true)
                {
                    commission = nowContract.commission.Value;
                }
                var model = new CreateDeliveryOrderViewModel
                {
                    idOrder                = order.idOrder,
                    description            = "Vừa lập đơn giao, nv giao nhanh chóng kiểm kê và đi giao",
                    idDistributor          = order.idDistributor,
                    distributorName        = order.Distributor.name,
                    DeliveryType           = order.DeliveryType,
                    PaymentType            = order.PaymentType,
                    estimateDateOfDelivery = order.EstimateDateOfDelivery,
                    recipient              = order.Consignee.Name,
                    recipientPhone         = order.Consignee.PhoneNumber,
                    totalPurchase          = 0,
                    deliveryDate           = DateTime.Now,
                    commission             = commission
                };

                // lấy km tốt nhất của order
                int       nPromotion = 0;
                Promotion promotion  = getPromotionOrder(order, out nPromotion);

                List <DetailedDeliveryOrder> listddOrder = new List <DetailedDeliveryOrder>();
                foreach (var item in order.OrderDetails)
                {
                    var ddOrder = new DetailedDeliveryOrder
                    {
                        idDeliveryOrder = model.idDeliveryOrder,
                        idProduct       = item.idProduct,
                        quantity        = item.quantity,
                        Product         = item.Product,
                        promoQuantity   = 0,
                        //idDeliveryOrder =1
                    };
                    listddOrder.Add(ddOrder);
                    model.totalPurchase += ddOrder.quantity * ddOrder.Product.Price;
                }
                // đưa sp km vào listddOrder
                if (promotion != null)
                {
                    foreach (var item in promotion.PromotionGifts)
                    {
                        bool check = true;
                        foreach (var item1 in listddOrder)
                        {
                            if (item.idProduct == item1.idProduct)
                            {
                                listddOrder.Remove(item1);
                                item1.promoQuantity = item.quantity * nPromotion;
                                item1.note          = "SLKM " + item.quantity * nPromotion + " từ CTKM số " + item.idPromotion;
                                listddOrder.Add(item1);
                                check = false;
                                break;
                            }
                        }
                        if (check)
                        {
                            var ddOrder = new DetailedDeliveryOrder
                            {
                                idProduct     = item.idProduct,
                                quantity      = 0,
                                promoQuantity = item.quantity * nPromotion,
                                Product       = item.Product,
                                note          = "SLKM " + item.quantity * nPromotion + " từ CTKM số " + item.idPromotion
                                                //idDeliveryOrder =1
                            };
                            listddOrder.Add(ddOrder);
                        }
                    }
                }
                model.DetailedDeliveryOrder = listddOrder;
                // những thuộc tính cần chọn khi lập đơn giao hàng
                ViewBag.Storage = order.Distributor.Storages.ToList();
                ViewBag.Staff   = _staffService.GetAll().ToList();
                //  tính chiết khấu
                model.totalPurchase = model.totalPurchase * (1 - model.commission / 100);
                return(View(model));
            }
        }
        [HttpGet][Route("")] public IActionResult GetAll()
        {
            var staffs = _staffService.GetAll();

            return(Ok(staffs));
        }
        public IActionResult GetAll()
        {
            var users = staffService.GetAll();

            return(Ok(users));
        }