Exemplo n.º 1
0
        public string AddOperatingSystem(OperatingSystemDetails Specyfication, string ProductName, string CodeProduct, int CategoryID, string OldPriceN, string PriceN, string VAT, string Description, int Quantity, bool Recommended, bool IsShowed)
        {
            Debug.WriteLine("system");
            string  answer = "";
            decimal parseOldPriceN;
            decimal parsePriceN;
            decimal parseVAT;

            answer = ProductManager.CheckDetailsProduct(ProductName, CodeProduct, CategoryID, OldPriceN, PriceN, VAT, Description, Quantity, Recommended, IsShowed, out parseOldPriceN, out parsePriceN, out parseVAT);
            if (!string.IsNullOrWhiteSpace(answer))
            {
                return(answer);
            }

            ProductViewModel product = new ProductViewModel
            {
                Name        = ProductName,
                CodeProduct = CodeProduct,
                CategoryID  = CategoryID,
                OldPriceN   = parseOldPriceN,
                PriceN      = parsePriceN,
                VAT         = parseVAT,
                Description = Description,
                Quantity    = Quantity,
                Recommended = Recommended,
                IsShowed    = IsShowed
            };

            if (ProductManager.CheckProductExistsName(ProductName))
            {
                return("-1");
            }
            ProductManager.AddOperatingSystem(Specyfication, product);
            TempData["Message"] = "Dodano produkt";
            return(ProductManager.GetNameCategoryAndProductID(product.Name));
        }
Exemplo n.º 2
0
        public DiagnosticsDummyFactory()
        {
            AutoFixtureBackedDummyFactory.AddDummyCreator(
                () =>
            {
                var result = new AssemblyDetails(
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <string>());

                return(result);
            });

            AutoFixtureBackedDummyFactory.AddDummyCreator(
                () =>
            {
                var result = new OperatingSystemDetails(
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <string>());

                return(result);
            });

            AutoFixtureBackedDummyFactory.AddDummyCreator(
                () =>
            {
                var result = new MachineDetails(
                    A.Dummy <Dictionary <string, string> >(),
                    A.Dummy <int>(),
                    A.Dummy <Dictionary <string, decimal> >(),
                    A.Dummy <bool>(),
                    A.Dummy <OperatingSystemDetails>(),
                    A.Dummy <string>());

                return(result);
            });

            AutoFixtureBackedDummyFactory.AddDummyCreator(
                () =>
            {
                var result = new ProcessDetails(
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <bool>());

                return(result);
            });

            AutoFixtureBackedDummyFactory.AddDummyCreator(
                () =>
            {
                var result = new PerformanceCounterDescription(
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <string>(),
                    A.Dummy <float>());

                return(result);
            });

            AutoFixtureBackedDummyFactory.AddDummyCreator(
                () =>
            {
                var result = new PerformanceCounterSample(
                    A.Dummy <PerformanceCounterDescription>(),
                    A.Dummy <float>());

                return(result);
            });
        }