예제 #1
0
        public PartialViewResult OnGetParameter(string names)
        {
            var namess        = names.Split(',');
            var walekName     = namess[0];
            var iloscNarzedzi = Convert.ToInt32(namess[2]);
            var iloscPrzejsc  = Convert.ToInt32(namess[3]);
            var stopien       = Convert.ToInt32(namess[4]);

            try
            {
                Walek.GetWalekByName(walekName, 1);
                Walek.Calculate(iloscPrzejsc);
            }
            catch (Exception)
            {
                return(new PartialViewResult
                {
                    ViewName = "_Exception",
                });

                throw;
            }

            try
            {
                var latheName = string.Join(" ", namess[1].Split('_'));
                var walek     = Walek.GetData();
                var lathe     = repository.GetObrabiarki(latheName).First();
                var tools     = repository.GetTools(lathe, "RG");
                var cmc       = repository.GetCmcMaterial(walek);
                var grades    = repository.GetGrades(cmc);
                var turnings  = repository.GetTurningTools(tools, lathe, walek, grades, iloscPrzejsc, stopien);

                parameters.SetParameterList(walek, lathe, cmc, turnings);
                parameters.Calculate();

                DataToTable.SetDataToTable(Walek.GetDataToTable());
                DataToTable.SetParameterToTable(parameters.GetParametersList(iloscNarzedzi));
                DataToTable.SetImages(lathe, parameters.GetParametersList(iloscNarzedzi), walek);
                DataToTable.StopienDoPokazania = stopien;

                GradesOptions = grades;

                return(new PartialViewResult
                {
                    ViewName = "_ParameterTables",
                    ViewData = new ViewDataDictionary <DaneWalkaDoTabel>(ViewData, DataToTable)
                });
            }
            catch (Exception e)
            {
                var message = e.Message;
                return(new PartialViewResult
                {
                    ViewName = "_Exception",
                    ViewData = new ViewDataDictionary <string>(ViewData, message)
                });
            }
        }
예제 #2
0
        //public IActionResult OnPostWalekSql()
        //{
        //    Walek.GetWalekByName(Name);
        //    Walek.Calculate();

        //    var walek = Walek.GetData();
        //    var lathe = repository.GetObrabiarki(Lathe).First();
        //    var tools = repository.GetTools(lathe, "RG");
        //    var cmc = repository.GetCmcMaterial(walek);
        //    var grades = repository.GetGrades(cmc);
        //    var turnings = repository.GetTurningTools(tools, lathe, walek, grades);

        //    parameters.SetParameterList(walek, lathe, cmc, turnings);
        //    parameters.Calculate();

        //    DataToTable.SetDataToTable(Walek.GetDataToTable());
        //    DataToTable.SetParameterToTable(parameters.GetParametersList());
        //    DataToTable.SetImages(lathe, parameters.GetParametersList(), walek);

        //    return RedirectToPage("Tabela");
        //}

        public PartialViewResult OnGetWalek(string walekName)
        {
            Walek.GetWalekByName(walekName, 1);
            Walek.Calculate(1);
            DaneWalka = Walek.GetData();
            DataToTable.SetDataToTable(Walek.GetDataToTable());
            DataToTable.SetWalekImage(DaneWalka);
            return(new PartialViewResult
            {
                ViewName = "_WalekTables",
                ViewData = new ViewDataDictionary <DaneWalkaDoTabel>(ViewData, DataToTable)
            });
        }