Example #1
0
        public ActionResult Create()
        {
            var offices = _myOfficeRepository.Search("").ToList();
            var model   = new ShippingFeeModel {
                MyOffices = offices
            };

            return(View(model));
        }
        public ActionResult CreateOrder(bool?blank, int?c, bool?f, bool?d)
        {
            if (!blank.HasValue || blank.Value)
            {
                OrderDetails       = new List <OrderDetailModel>();
                OrderSession       = new OrderModel();
                OrderDetailSession = new OrderDetailModel();
            }
            if (d.HasValue)
            {
                OrderDetailSession = new OrderDetailModel();
            }
            var offices          = _myOfficeRepository.Search("").Where(p => !p.IsRetailCustomer).ToList();
            var shippingServices = new List <ShippingService>();
            var model            = new OrderModel
            {
                MyOffices         = offices,
                ShippingServices  = shippingServices,
                PaymentType       = OrderSession.PaymentType > 0 ? OrderSession.PaymentType : (int)PaymentTypes.InShippingPlace,
                CustomerId        = OrderSession.CustomerId,
                CustomerName      = OrderSession.CustomerName,
                MyOfficeId        = OrderSession.MyOfficeId,
                Note              = OrderSession.Note,
                ShippingServiceId = OrderSession.ShippingServiceId,
                ShowOnTop         = OrderSession.ShowOnTop,
                WaitForPrint      = OrderSession.WaitForPrint,
                HaveShippingFee   = OrderSession.HaveShippingFee,
                CustomerPhone     = OrderSession.CustomerPhone
            };

            if (c.HasValue)
            {
                var customer = _customerRepository.GetById(c.Value);
                model.CustomerAddress = customer.Address;
                model.CustomerName    = customer.CustomerName;
                model.CustomerPhone   = customer.PhoneNumber;
                model.CellPhoneNumber = customer.CellPhoneNumber;
                model.CustomerCode    = customer.CustomerCode;
                model.Fax             = customer.Fax;
                model.CustomerId      = customer.CustomerId;
                model.MyOfficeId      = customer.MyOfficeId;
                var lastOrder = _orderRepository.Search("").FirstOrDefault(p => p.CustomerId == c.Value);
                if (lastOrder != null)
                {
                    model.MyOfficeId        = lastOrder.MyOfficeId;
                    model.ShippingServiceId = lastOrder.ShippingServiceId;
                    model.PaymentType       = lastOrder.PaymentType;
                }
            }
            if (f.HasValue)
            {
                model.Finished = true;
            }
            return(View(model));
        }
Example #3
0
        //
        // GET: /Administrator/MyOffice/


        public ActionResult Index()
        {
            var offices   = _myOfficeRepository.Search("").Where(p => WorkContext.MyOffices.Contains(p.MyOfficeId)).ToList();
            var customers = _customerRepository.Search("").Where(p => WorkContext.MyOffices.Contains(p.MyOfficeId)).ToList();
            var model     = new OrderModel
            {
                MyOffices = offices,
                Customers = customers
            };

            return(View(model));
        }
Example #4
0
        public ActionResult Create()
        {
            var offices  = _myOfficeRepository.Search("").ToList();
            var products = _productRepository.Search("").ToList();
            var model    = new RateMappingModel()
            {
                MyOffices = offices,
                Products  = products
            };

            return(View(model));
        }
Example #5
0
        //
        // GET: /Administrator/MyOffice/

        public ActionResult Index()
        {
            var customers = _customerRepository.Search("").Where(p => WorkContext.MyOffices.Contains(p.MyOfficeId)).ToList();
            var offices   = _myOfficeRepository.Search("").Where(p => WorkContext.MyOffices.Contains(p.MyOfficeId)).ToList();
            var products  = _productRepository.Search("").ToList();
            var model     = new ExportTrackModel
            {
                Customers = customers,
                MyOffices = offices,
                Products  = products
            };

            return(View(model));
        }
Example #6
0
        public ActionResult Create()
        {
            var listRole = _roleRepository.Search("").ToList();

            listRole = listRole.Where(p => p.RoleId != 9).ToList();
            var listOffice  = _myOfficeRepository.Search(string.Empty).ToList();
            var listStorage = _storageRepository.Search(string.Empty).ToList();
            var userModel   = new UserModel()
            {
                AvailableUserRoles = listRole,
                AvailableOffices   = listOffice,
                AvailableStorages  = listStorage,
                IsLockedOut        = true,
                AllowLoginFrom     = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 7, 0, 0),
                AllowLoginTo       = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 19, 0, 0),
            };

            return(View(userModel));
        }
Example #7
0
        public ActionResult GridModel(string search)
        {
            var model      = Repository.Search(search).ToList();
            var listOffice = _myOfficeRepository.Search("").ToList();
            var gridModel  = new GridModel <StateProvinceModel>
            {
                Data = model.Select(x =>
                {
                    var firstOrDefault = listOffice.FirstOrDefault(p => p.MyOfficeId == x.MyOfficeId);
                    return(new StateProvinceModel
                    {
                        StateProvinceId = x.StateProvinceId,
                        StateProvinceCode = x.StateProvinceCode,
                        StateProvinceName = x.StateProvinceName,
                        RegionName = firstOrDefault != null ? firstOrDefault.OfficeName : string.Empty
                    });
                })
            };

            return(new JsonResult
            {
                Data = gridModel
            });
        }
Example #8
0
        //
        // GET: /Administrator/MyOffice/

        public ActionResult Index()
        {
            var myOffices = _myOfficeRepository.Search("").Where(p => WorkContext.MyOffices.Contains(p.MyOfficeId)).ToList();
            var employees = _userRepository.Search("").ToList();
            var model     = new ExpenseModel
            {
                MyOffices = myOffices,
                Employees = employees
            };

            return(View(model));
        }