Exemplo n.º 1
0
        public ActionResult Index()
        {
            var model = new CustomerViewModel();

            var customers = new List <CustomerViewModel>();

            var tempCustomers = _customerDynamicsRepository.GetCustomers().Where(x => x.INACTIVE != 1).ToList();

            if (tempCustomers != null && tempCustomers.Count > 0)
            {
                foreach (var tempCustomer in tempCustomers)
                {
                    CustomerViewModel convertedModel = new CustomerConverter().ConvertToListView(tempCustomer);

                    customers.Add(convertedModel);
                }
            }

            model.Customers = customers.OrderBy(x => x.ShortName).ToList();

            model.SelectableShipmentTerms = _shipmentTermRepository.GetSelectableShipmentTerms();

            var defaultShipmentTerm = new SelectListItem()
            {
                Text  = "--Select Shipment Term--",
                Value = null
            };

            model.SelectableShipmentTerms.Insert(0, defaultShipmentTerm);

            model.SelectablePaymentTerms = _paymentTermRepository.GetSelectablePaymentTerms();

            var defaultPaymentTerm = new SelectListItem()
            {
                Text  = "--Select Payment Term--",
                Value = null
            };

            model.SelectablePaymentTerms.Insert(0, defaultPaymentTerm);

            model.SelectableStates = _stateRepository.GetSelectableStates();

            var defaultState = new SelectListItem()
            {
                Text  = "--Select State--",
                Value = null
            };

            model.SelectableStates.Insert(0, defaultState);

            model.SelectableCountries = _countryRepository.GetSelectableCountries();

            var defaultCountry = new SelectListItem()
            {
                Text  = "--Select Country--",
                Value = null
            };

            model.SelectableCountries.Insert(0, defaultCountry);

            model.SelectableSalespersons = _salespersonDynamicsRepository.GetSelectableSalespersons();

            var defaultSalesperson = new SelectListItem()
            {
                Text  = "--Select Salesperson--",
                Value = null
            };

            model.SelectableSalespersons.Insert(0, defaultSalesperson);

            model.SelectableSites = _siteDynamicsRepository.GetSelectableSites();

            var defaultSite = new SelectListItem()
            {
                Text  = "--Select Site--",
                Value = null
            };

            model.SelectableSites.Insert(0, defaultSite);

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Detail(Guid partId)
        {
            var model = new PartViewModel();

            var currentPart = _projectPartRepository.GetProjectPart(partId);

            if (currentPart != null)
            {
                var projectPart = _projectPartRepository.GetProjectPart(partId);

                model = new ProjectPartConverter().ConvertToView(projectPart);
            }
            else
            {
                var part = _partRepository.GetPart(partId);

                model = new PartConverter().ConvertToView(part);
            }

            model.SelectableCustomers = _customerDynamicsRepository.GetSelectableCustomers();

            var defaultCustomer = new SelectListItem()
            {
                Text  = "--Select Customer--",
                Value = null
            };

            model.SelectableCustomers.Insert(0, defaultCustomer);

            model.SelectableFoundries = _foundryDynamicsRepository.GetSelectableFoundries();

            var defaultFoundry = new SelectListItem()
            {
                Text  = "--Select Foundry--",
                Value = null
            };

            model.SelectableFoundries.Insert(0, defaultFoundry);

            var htsNumbers = _htsNumberRepository.GetSelectableHtsNumbers();

            var defaultHtsNumber = new SelectListItem()
            {
                Text  = "--Select Hts Number--",
                Value = null
            };

            htsNumbers.Insert(0, defaultHtsNumber);

            model.SelectableHtsNumbers = htsNumbers;

            var material = _materialRepository.GetSelectableMaterials();

            var defaultMaterial = new SelectListItem()
            {
                Text  = "--Select Material--",
                Value = null
            };

            material.Insert(0, defaultMaterial);

            model.SelectableMaterial = material;

            var specificationMaterial = _specificationMaterialRepository.GetSelectableSpecificationMaterials();

            var defaultSpecification = new SelectListItem()
            {
                Text  = "--Select Material Specification--",
                Value = null
            };

            specificationMaterial.Insert(0, defaultSpecification);

            model.SelectableSpecificationMaterial = specificationMaterial;

            var partStates = _partStatusRepository.GetSelectablePartStates();

            var defaultPartStatus = new SelectListItem()
            {
                Text  = "--Select Part Status--",
                Value = null
            };

            partStates.Insert(0, defaultPartStatus);

            model.SelectablePartStates = partStates;

            var destinations = _destinationRepository.GetSelectableDestinations();

            var defaultDestination = new SelectListItem()
            {
                Text  = "--Select Destination--",
                Value = null
            };

            destinations.Insert(0, defaultDestination);

            model.SelectableDestinations = destinations;

            var partTypes = _partTypeRepository.GetSelectablePartTypes();

            var defaultPartType = new SelectListItem()
            {
                Text  = "--Select Part Type--",
                Value = null
            };

            partTypes.Insert(0, defaultPartType);

            model.SelectablePartTypes = partTypes;

            model.SelectableProjects = _projectRepository.GetSelectablePartProjects(partId);

            var paymentTerms = _paymentTermRepository.GetSelectablePaymentTerms();

            var defaultPaymentTerm = new SelectListItem()
            {
                Text  = "--Select Payment Term--",
                Value = null
            };

            paymentTerms.Insert(0, defaultPaymentTerm);

            model.SelectablePaymentTerms = paymentTerms;

            var shipmentTerms = _shipmentTermRepository.GetSelectableShipmentTerms();

            var defaultShipmentTerm = new SelectListItem()
            {
                Text  = "--Select Shipment Term--",
                Value = null
            };

            shipmentTerms.Insert(0, defaultShipmentTerm);

            model.SelectableShipmentTerms = shipmentTerms;

            var surcharge = _surchargeRepository.GetSelectableSurcharges();

            model.SelectableSurcharge = surcharge;

            var defaultSurcharge = new SelectListItem()
            {
                Text  = "--Select Surcharge--",
                Value = null
            };

            surcharge.Insert(0, defaultSurcharge);

            model.SelectableSites = _siteDynamicsRepository.GetSelectableSites();

            var defaultSite = new SelectListItem()
            {
                Text  = "--Select Site--",
                Value = null
            };

            model.SelectableSites.Insert(0, defaultSite);

            var coatingTypes = _coatingTypeRepository.GetSelectableCoatingTypes();

            var defaultCoatingType = new SelectListItem()
            {
                Text  = "--Select Coating Type--",
                Value = null
            };

            coatingTypes.Insert(0, defaultCoatingType);

            model.SelectableCoatingTypes = coatingTypes;

            var patternMaterial = _patternMaterialRepository.GetSelectablePatternMaterials();

            var defaultPattern = new SelectListItem()
            {
                Text  = "--Select Pattern Material--",
                Value = null
            };

            patternMaterial.Insert(0, defaultPattern);

            model.SelectablePatternMaterial = patternMaterial;

            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult Standard()
        {
            QuoteViewModel model = new QuoteViewModel();

            model.QuoteNumber = QuoteNumber();

            _quoteRepository.RemoveQuoteNumber(model.QuoteNumber);

            model.Date         = DateTime.Now.ToShortDateString();
            model.QuoteDateStr = DateTime.Now.ToShortDateString();
            model.RfqNumber    = "N/A";
            model.Machining    = "Not Included";

            model.SelectableCustomers = _customerDynamicsRepository.GetSelectableCustomers();

            var defaultCustomer = new SelectListItem()
            {
                Text  = "--Select Customer--",
                Value = null
            };

            model.SelectableCustomers.Insert(0, defaultCustomer);

            model.SelectableProjects = _projectRepository.GetSelectableActiveProjects();

            var defaultProject = new SelectListItem()
            {
                Text  = "--Select Project--",
                Value = null
            };

            model.SelectableProjects.Insert(0, defaultProject);

            model.SelectableShipmentTerms = _shipmentTermRepository.GetSelectableShipmentTerms();

            var defaultShipmentTerm = new SelectListItem()
            {
                Text  = "--Select Shipment Term--",
                Value = null
            };

            model.SelectableShipmentTerms.Insert(0, defaultShipmentTerm);

            model.SelectablePaymentTerms = _paymentTermRepository.GetSelectablePaymentTerms();

            var defaultPaymentTerm = new SelectListItem()
            {
                Text  = "--Select Payment Term--",
                Value = null
            };

            model.SelectablePaymentTerms.Insert(0, defaultPaymentTerm);

            model.SelectableMaterial = _materialRepository.GetSelectableMaterials();

            var defaultMaterial = new SelectListItem()
            {
                Text  = "--Select Material--",
                Value = null
            };

            model.SelectableMaterial.Insert(0, defaultMaterial);

            model.SelectableCoatingTypes = _coatingTypeRepository.GetSelectableCoatingTypes();

            var defaultCoatingType = new SelectListItem()
            {
                Text  = "--Select Coating Type--",
                Value = null
            };

            model.SelectableCoatingTypes.Insert(0, defaultCoatingType);

            model.SelectableHtsNumbers = _htsNumberRepository.GetSelectableHtsNumbers();

            var defaultHtsNumber = new SelectListItem()
            {
                Text  = "--Select HtsNumber--",
                Value = null
            };

            model.SelectableHtsNumbers.Insert(0, defaultHtsNumber);

            return(View(model));
        }