Exemple #1
0
        public async Task <IActionResult> SOPreviewEdit(int RequestID)
        {
            if (RequestID == 0)
            {
                return(RedirectToAction("ServiceRequests"));
            }

            var model = new ServiceRequestModel();

            var serviceRequest = await _workorderService.GetServiceRequestById(RequestID);

            model = _mapper.Map <ServiceRequestModel>(serviceRequest);

            model.AvailableEmployee.Add(new SelectListItem {
                Text = "Employee", Value = "0"
            });
            foreach (var item in _logonRepository.Table.Where(l => l.ClientId == (int)_workContext.CurrentCustomer.ClientId && l.UserType == 12))
            {
                model.AvailableEmployee.Add(new SelectListItem {
                    Text = item.UserName, Value = item.LogonId.ToString()
                });
            }

            model.AvailableServiceContract.Add(new SelectListItem {
                Text = "Provider", Value = "0"
            });
            foreach (var item in _serviceContractRepository.Table.Where(l => l.ClientId == (int)_workContext.CurrentCustomer.ClientId))
            {
                model.AvailableServiceContract.Add(new SelectListItem {
                    Text = item.Scvendor, Value = item.Scid.ToString()
                });
            }

            foreach (var item in (await _financialManagementService.GetGeneralLedger(
                                      (int)_workContext.CurrentCustomer.ClientId)))
            {
                model.AvailableGL.Add(new SelectListItem {
                    Text = item.Gldescription, Value = item.Gl1.ToString()
                });
            }

            foreach (var item in (await _costCenterService.SelectCostCenter((int)_workContext.CurrentCustomer.ClientId,
                                                                            (int)_workContext.CurrentCustomer.UserType,
                                                                            _workContext.CurrentCustomer.LogonId)))
            {
                model.AvailableLocation.Add(new SelectListItem {
                    Text = item.Both, Value = item.Sid.ToString()
                });
            }

            return(View(model));
        }
Exemple #2
0
        public async Task <IActionResult> Oi1_Invent(int VitemID)
        {
            if (VitemID == 0)
            {
                return(RedirectToAction("InventoryControl"));
            }

            var model = await _selectItemService.GetEditItem(VitemID);

            if (model == null)
            {
                return(RedirectToAction("InventoryControl"));
            }

            //category dropdown
            foreach (var item in (await _invManagement.SelectCostCenter(
                                      (int)_workContext.CurrentCustomer.ClientId,
                                      (int)_workContext.CurrentCustomer.UserType,
                                      (int)_workContext.CurrentCustomer.LogonId)))
            {
                model.AvailableShipLocations.Add(new SelectListItem {
                    Text = item.Both, Value = item.Sid.ToString()
                });
            }

            model.AvailableGeneralList.Add(new SelectListItem {
                Text = "Select", Value = "0"
            });
            foreach (var item in (await _financialManagementService.GetGeneralLedger(
                                      (int)_workContext.CurrentCustomer.ClientId)))
            {
                model.AvailableGeneralList.Add(new SelectListItem {
                    Text = item.Gldescription, Value = item.Gl1.ToString()
                });
            }

            return(View(model));
        }