Exemplo n.º 1
0
 void FillStaffFacilities(Classes.StaffFacilities sf)
 {
     txtStaffExperience.Text       = sf.Experience.ToString();
     txtStaffMotivation.Text       = sf.Motivation.ToString();
     txtStaffTSkills.Text          = sf.Technicalskill.ToString();
     txtStaffStressHandling.Text   = sf.Stresshandling.ToString();
     txtStaffConcentration.Text    = sf.Concentration.ToString();
     txtStaffEfficiency.Text       = sf.Efficiency.ToString();
     txtFacilitiesWindtunnel.Text  = sf.Windtunnel.ToString();
     txtFacilitiesPitstop.Text     = sf.Pitstoptrainingcenter.ToString();
     txtFacilitiesRDWorkshop.Text  = sf.RDworkshop.ToString();
     txtFacilitiesRDDesign.Text    = sf.RDdesigncenter.ToString();
     txtFacilitiesEngineering.Text = sf.Engineeringworkshop.ToString();
     txtFacilitiesAlloy.Text       = sf.Alloyandchemicallab.ToString();
     txtFacilitiesCommercial.Text  = sf.Commercial.ToString();
 }
Exemplo n.º 2
0
        void SaveSkills()//testing car
        {
            //Read values from form
            Classes.Car               car     = ReadCarFromForm();
            Classes.Driver            driver  = ReadDriverFromForm();
            Classes.TechnicalDirector td      = ReadTdFromForm();
            Classes.StaffFacilities   sf      = ReadSfFromForm();
            Classes.Weather           weather = ReadWeatherFromForm();
            int activeTyreCode = GetTyreCodeFromSkillTab();

            //Call the Save methods
            DB.Car.UpdateCarToDb(car);
            DB.Driver.UpdateDriverToDb(driver);
            DB.TechnicalDirector.UpdateTdToDb(td);
            DB.StaffFacilities.UpdateStaffFacilitiesToDb(sf);
            DB.Weather.UpdateWeatherToDb(weather);
            DB.Tyres.UpdateTyreToDb(activeTyreCode);
        }
Exemplo n.º 3
0
        void InitiateSkillsTab()
        {
            Classes.Driver driver = DB.Driver.ReadDriverFromDB();
            FillDriver(driver);
            Classes.Car car = DB.Car.ReadCarFromDB();
            FillCar(car);
            Classes.TechnicalDirector td = DB.TechnicalDirector.ReadTdFromDB();
            FillTd(td);
            Classes.StaffFacilities sf = DB.StaffFacilities.ReadStaffFacilitiesFromDB();
            FillStaffFacilities(sf);
            UpdateStaffAndFacilitiesCost(sf);
            Classes.Weather w = DB.Weather.ReadWeatherFromDB();
            FillWeather(w);
            int activeTyreSupplierId = DB.ActiveTyreSupplier.GetTyreSupplierId();

            Classes.TyresSupplier tyre = DB.Tyres.ReadTyreFromSupplierDB(activeTyreSupplierId);
            FillActiveTyreSupplier(tyre);
        }
Exemplo n.º 4
0
        Classes.StaffFacilities ReadSfFromForm()
        {
            Classes.StaffFacilities sf = new Classes.StaffFacilities();


            sf.Experience     = int.Parse(txtStaffExperience.Text);
            sf.Motivation     = int.Parse(txtStaffMotivation.Text);
            sf.Technicalskill = int.Parse(txtStaffTSkills.Text);
            sf.Stresshandling = int.Parse(txtStaffStressHandling.Text);
            sf.Concentration  = int.Parse(txtStaffConcentration.Text);
            sf.Efficiency     = int.Parse(txtStaffEfficiency.Text);

            sf.Windtunnel            = int.Parse(txtFacilitiesWindtunnel.Text);
            sf.Pitstoptrainingcenter = int.Parse(txtFacilitiesPitstop.Text);
            sf.RDworkshop            = int.Parse(txtFacilitiesRDWorkshop.Text);
            sf.RDdesigncenter        = int.Parse(txtFacilitiesRDDesign.Text);
            sf.Engineeringworkshop   = int.Parse(txtFacilitiesEngineering.Text);
            sf.Alloyandchemicallab   = int.Parse(txtFacilitiesAlloy.Text);
            sf.Commercial            = int.Parse(txtFacilitiesCommercial.Text);

            sf.Id = 1;

            return(sf);
        }
Exemplo n.º 5
0
        int GetFacilitiesCost(Classes.StaffFacilities sf)
        {
            int costs = 5000 * (sf.Windtunnel + sf.Pitstoptrainingcenter + sf.RDdesigncenter + sf.RDworkshop + sf.Engineeringworkshop + sf.Alloyandchemicallab + sf.Commercial);

            return(costs);
        }
Exemplo n.º 6
0
        int GetStaffCost(Classes.StaffFacilities sf)
        {
            int costs = 11 * sf.Stresshandling + 6 * sf.Concentration + 18 * sf.Efficiency;

            return(costs * 1000);
        }
Exemplo n.º 7
0
 void UpdateStaffAndFacilitiesCost(Classes.StaffFacilities sf)
 {
     lblStaffSalary.Text           = GetStaffCost(sf).ToString();
     lblFacilitiesMaintenance.Text = GetFacilitiesCost(sf).ToString();
 }