protected void ModuleNameDDL_SelectedIndexChanged(object sender, EventArgs e) { ProductionCycle SelectedProdID = new ProductionCycle(); try { HatcheryEntities db = new HatcheryEntities(); var ProdCycleQuery = from ProdCycle in db.ProductionCycles where ProdCycle.ModuleName == ModuleNameDDL.SelectedValue && ProdCycle.isInProduction == true select ProdCycle; SelectedProdID = ProdCycleQuery.SingleOrDefault(); } catch (Exception) { } try { var report = new Telerik.Reporting.InstanceReportSource(); report.ReportDocument = new HatcheryReportLibrary.CompletePLReport(); report.Parameters.Add("ProductionCycleIDParameter", SelectedProdID.ProductionCycleID); this.ReportViewer1.ReportSource = report; } catch (Exception) { } }
private void StartNewProduction() { BuildingsData dataWithoutEnergy = GetDataWithoutEnergyResource(data); productionCycle = new ProductionCycle(dataWithoutEnergy, OnProductionCycleCompletedHandler); PlayerResources.OnResourceChanged -= CheckIfNecessaryInputResourcesAreAvailable; //PlayerResources.OnMoneyChanged -= (x) => CheckIfNecessaryInputResourcesAreAvailable(); OnProductionInputProcessed(this, dataWithoutEnergy); if (!enabled) { enabled = true; } ToggleBuildingEffects(true); if (!sentEnergyCapacity) { if (OnBuildingEnabled != null) { OnBuildingEnabled(this); } sentEnergyCapacity = true; } }
private void OnProductionCycleCompletedHandler(ProductionCycleResult result) { productionCycle = null; OnProductionCycleCompleted(this, result); StartCoroutine(WaitForNewProductionStart()); }