public Boolean HasCircularReference(Application application, Int64 forServiceId) { Boolean circularReferenceFound = false; Service medicalService; ServiceSet serviceSet; if (definitionServiceId == forServiceId) { return(true); } medicalService = new Service(application, forServiceId); if (medicalService.ServiceType == Mercury.Server.Core.MedicalServices.Enumerations.MedicalServiceType.Set) { serviceSet = new ServiceSet(application, forServiceId); foreach (ServiceSetDefinition currentDefinition in serviceSet.Definitions) { circularReferenceFound = circularReferenceFound || (currentDefinition.HasCircularReference(application, forServiceId)); if (circularReferenceFound) { break; } } } return(circularReferenceFound); }
AnimationFrame() { var provider = ServiceSet.Get <IResourceProvider>(); Texture = provider.GetItemTexture(1); Center = new Vector2Int(0, 0); }
public ContextMenuItem(int responseCode, int stringId, int flags, int hue) { // get the resource provider var provider = ServiceSet.Get <IResourceProvider>(); Caption = provider.GetString(stringId); ResponseCode = responseCode; }
public void Set(TService service) { m_service = service; if (service != null) { ServiceSet?.Invoke(this, service); } }
private void button_repaired_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox_price.Text)) { MessageBox.Show("Wpisz poniesiony koszt na naprawę", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { int row = dataGridView_cars_on_service.CurrentCell.RowIndex; int car_id = (int)dataGridView_cars_on_service.Rows[row].Cells[0].Value; int service_id = (int)dataGridView_cars_on_service.Rows[row].Cells[1].Value; Care_serviceSet care = db.Care_serviceSets.Where(p => p.ServiceSet.service_id == service_id).First(); care.data_to = DateTime.Today; Check_vehicleSet check = db.Check_vehicleSets.Where(p => p.Vehicle_vehicle_id == car_id).First(); ServiceSet service = db.ServiceSets.Where(p => p.service_id == service_id).First(); service.is_repair = true; VehicleSet veh = db.VehicleSets.Where(p => p.vehicle_id == car_id).First(); veh.available = "yes"; if (service.name == "Wymiana oleju + filtry") { check.oil_change_mileage += 15000; } else if (service.name == "Wymiana rozrzadu") { check.timing_gear_mileage += 15000; } else if (service.name == "Przegląd") { check.tech_review.AddYears(1); } care.price = Convert.ToDouble(textBox_price.Text); db.SubmitChanges(); fillDataGridView(); fillDataGridView2(); textBox_price.Clear(); } catch (Exception) { MessageBox.Show("Zaznacz samochód, który został naprawiony", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void button_reserv_Click(object sender, EventArgs e) { if (comboBox_service.SelectedIndex == -1 || string.IsNullOrEmpty(textBox_description.Text)) { MessageBox.Show("Wybierz przyczynę serwisu i opisz problem", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { int row = dataGridView_care_car_DB.CurrentCell.RowIndex; car_id = (int)dataGridView_care_car_DB.Rows[row].Cells[0].Value; var count_Reservations = db.ReservationSets .Where(x => x.Vehicle_vehicle_id == car_id && x.Worker_worker_id == user_id && ((x.date_from <= dateTimePicker_from_date_reserv.Value && x.date_to >= dateTimePicker_from_date_reserv.Value) || (x.date_from <= dateTimePicker_to_date_reserv.Value && x.date_to >= dateTimePicker_to_date_reserv.Value))) .Select(x => x.reservation_id) .Count(); if (count_Reservations == 0) { try { string company_name; VehicleSet vechicle = db.VehicleSets.Where(x => x.vehicle_id == car_id).First(); //vechicle.available = "no"; CareSet care_id = db.CareSets .Where(x => x.Vehicle_vehicle_id == car_id) .First(); company_name = comboBox_Company_name.Text; CompanySet company_id = db.CompanySets .Where(x => x.name == company_name) .First(); try { ServiceSet service = new ServiceSet() { is_repair = false, name = comboBox_service.Text, description = textBox_description.Text }; db.ServiceSets.InsertOnSubmit(service); db.SubmitChanges(); } catch (Exception) { MessageBox.Show("Nie udało się oddać auta do serwisu", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { ServiceSet service = db.ServiceSets.OrderByDescending(p => p.service_id).First(); Care_serviceSet newservice = new Care_serviceSet() { date_from = dateTimePicker_from_date_reserv.Value, data_to = Convert.ToDateTime("1999-01-01 00:00:00.000"), Care_care_id = care_id.care_id, Service_service_id = service.service_id, price = -10, Company_company_id = company_id.company_id }; db.Care_serviceSets.InsertOnSubmit(newservice); db.SubmitChanges(); MessageBox.Show("Zarezerwowałeś pojazd od " + dateTimePicker_from_date_reserv.Value.ToShortDateString(), "Good Reservation", MessageBoxButtons.OK, MessageBoxIcon.Information); fillDataGridView(); } catch (Exception) { MessageBox.Show("Nie dodało się do bazy care_service", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { WorkerSet worker; try { var people = (from x in db.ReservationSets where ((x.date_from >= dateTimePicker_from_date_reserv.Value && x.date_from <= dateTimePicker_to_date_reserv.Value) || (x.date_to >= dateTimePicker_from_date_reserv.Value && x.date_to <= dateTimePicker_to_date_reserv.Value) || (x.date_from >= dateTimePicker_from_date_reserv.Value && x.date_to <= dateTimePicker_to_date_reserv.Value)) && x.Vehicle_vehicle_id == vechicle.vehicle_id && x.Worker_worker_id != user_id select x.Worker_worker_id).Distinct(); string peoples = "Powiadom następujące osoby o wysyłaniu pojazdu na serwis w terminie ich rezerwacji, oraz poproś o usunięcie owej rezerwacji: \n "; foreach (int id in people) { worker = db.WorkerSets.Where(x => x.worker_id == id).SingleOrDefault(); peoples += worker.name + " " + worker.surname + " nr telefonu do pracownika: " + worker.phone_nr.ToString() + "\n"; } if (peoples == "Powiadom następujące osoby o wysyłaniu pojazdu na serwis w terminie ich rezerwacji, oraz poproś o usunięcie owej rezerwacji: \n ") { } else { MessageBox.Show(peoples, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception) { } ReservationSet newreserv = new ReservationSet() { date_from = dateTimePicker_from_date_reserv.Value, date_to = dateTimePicker_to_date_reserv.Value, purpose = "Serwis", Worker_worker_id = user_id, Vehicle_vehicle_id = vechicle.vehicle_id }; db.ReservationSets.InsertOnSubmit(newreserv); db.SubmitChanges(); } catch (Exception) { MessageBox.Show("Nie udało się stworzyć rezerwacji", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception) { MessageBox.Show("Zaznacz samochód", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Masz już zarezerwowane auto w takim okresie", "Error Reservation", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public NeuraliumAccreditationCertificatesSnapshotSqliteDal(long groupSize, string folderPath, ServiceSet serviceSet, IChainDalCreationFactory chainDalCreationFactory, AppSettingsBase.SerializationTypes serializationType) : base(groupSize, folderPath, serviceSet, chainDalCreationFactory, serializationType) { }
private void button_send_to_service_Click(object sender, EventArgs e) { if (Combobox_service.SelectedIndex == -1 || string.IsNullOrEmpty(textBox_description.Text)) { MessageBox.Show("Wybierz przyczynę serwisu i opisz problem", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { int row = dataGridView_care_car_DB.CurrentCell.RowIndex; car_id = (int)dataGridView_care_car_DB.Rows[row].Cells[0].Value; string company_name; VehicleSet vechicle = db.VehicleSets.Where(x => x.vehicle_id == car_id).First(); vechicle.available = "Serwis"; CareSet care_id = db.CareSets .Where(x => x.Vehicle_vehicle_id == car_id) .First(); company_name = comboBox_Company_name.Text; CompanySet company_id = db.CompanySets .Where(x => x.name == company_name) .First(); try { ServiceSet service = new ServiceSet() { is_repair = false, name = Combobox_service.Text, description = textBox_description.Text }; db.ServiceSets.InsertOnSubmit(service); db.SubmitChanges(); } catch (Exception) { MessageBox.Show("Nie udało się oddać auta do serwisu", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { ServiceSet service = db.ServiceSets.OrderByDescending(p => p.service_id).First(); Care_serviceSet newservice = new Care_serviceSet() { date_from = DateTime.Today, data_to = Convert.ToDateTime("1999 - 01 - 01 00:00:00.000"), Care_care_id = care_id.care_id, Service_service_id = service.service_id, price = -10, Company_company_id = company_id.company_id }; db.Care_serviceSets.InsertOnSubmit(newservice); db.SubmitChanges(); fillDataGridView(); fillDataGridView2(); } catch (Exception) { MessageBox.Show("Nie dodało się do bazy care_service", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception) { MessageBox.Show("Zaznacz samochód", "Error check", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }