public ActionResult Branch_Wise_Plan(Int64 ID) { try { var Branch_Selected = db.Planes.Join(db.Branch_Wise_Plane, j => j.ID, u => u.Plane_ID, (j, u) => new { Branch_Plane = u, Plane = j }).Where(i => i.Branch_Plane.Branch_ID == ID).ToList(); List <Branch_Wise_PlanePlaneModel> Branch_Wise_PlanePlaneModelList = new List <Branch_Wise_PlanePlaneModel>(); foreach (var d in Branch_Selected) { Branch_Wise_PlanePlaneModel Branch_Wise_PlaneBranchModel = new Branch_Wise_PlanePlaneModel(); PlaneModel PlaneModel = new PlaneModel(); Branch_Wise_PlaneModel Branch_Wise_PlaneModel = new Branch_Wise_PlaneModel(); PlaneModel.Name = d.Plane.Name; PlaneModel.Duration = d.Plane.Duration; PlaneModel.Duration_No = d.Plane.Duration_No; PlaneModel.Worth = d.Plane.Worth; Branch_Wise_PlaneModel.Status = d.Branch_Plane.Status; Branch_Wise_PlaneModel.ID = d.Branch_Plane.ID; Branch_Wise_PlaneBranchModel.PlaneModel = PlaneModel; Branch_Wise_PlaneBranchModel.Branch_Wise_PlaneModel = Branch_Wise_PlaneModel; Branch_Wise_PlanePlaneModelList.Add(Branch_Wise_PlaneBranchModel); } return(View(Branch_Wise_PlanePlaneModelList)); } catch (Exception ex) { return(RedirectToAction("Contact", "Home")); } }
public void PlaneRepository_CreatePlane(PlaneModel plane) { repository.CreatePlaneModel(plane); var createdPlane = repository.GetAll().FirstOrDefault(u => u.Name == plane.Name); plane = createdPlane; }
private void Button_Click(object sender, RoutedEventArgs e) { if (trajetList.SelectedValue != null && datedebut.SelectedDate != null && datefin.SelectedDate != null && PresetTimePickerDebut.SelectedTime != null && PresetTimePickerFin.SelectedTime != null) { if (datedebut.SelectedDate > minD && datefin.SelectedDate < maxF) { FlyModel.AddFly(new Fly() { hour_start = datedebut.SelectedDate.Value.AddHours(PresetTimePickerDebut.SelectedTime.Value.Hour).AddMinutes(PresetTimePickerDebut.SelectedTime.Value.Minute), hour_end = datefin.SelectedDate.Value.AddHours(PresetTimePickerFin.SelectedTime.Value.Hour).AddMinutes(PresetTimePickerFin.SelectedTime.Value.Minute), trip_used = TripModel.GetTrip(Convert.ToInt32(trajetList.SelectedValue)), plane = PlaneModel.GetPlane(idAvion) }); Close(); } else { MessageBox.Show("Veuillez choisir les dates de départ et d'arrivé entre le " + minD + " et le " + maxF + ""); } } else { Error.Visibility = Visibility.Visible; } }
public ActionResult Create() { try { int Branvch_ID = Convert.ToInt32(Session["Branvch_ID"]); var status = new List <string>() { "True", "False" }; ViewBag.Form_Fee = status; var Plane_NAMES = db.Branch_Wise_Plane.Where(i => i.Branch_ID == Branvch_ID && i.Status == true).ToList(); List <PlaneModel> PlaneModelList = new List <PlaneModel>(); foreach (var Plane_NAME in Plane_NAMES) { PlaneModel PlaneModel = new PlaneModel(); var Plane = db.Planes.Where(i => i.ID == Plane_NAME.Plane_ID).FirstOrDefault(); PlaneModel.Name = Plane.Name; PlaneModel.ID = Plane.ID; PlaneModelList.Add(PlaneModel); } ViewBag.Plane_NAME = PlaneModelList; return(View()); } catch (Exception ex) { return(RedirectToAction("Contact", "Home")); } }
public JoyStickView() { this.vm = new JoyStickViewModel(PlaneModel.GetModel()); InitializeComponent(); vm.PropertyChanged += AileronChanged; vm.PropertyChanged += ElevatorChanged; }
public ActionResult Index() { try { int GYM_ID = Convert.ToInt32(Session["GYM_ID"]); var Plane = db.Planes.Where(i => i.GYM_ID == GYM_ID).OrderByDescending(i => i.ID).ToList(); List <PlaneTotalModel> PlaneTotalModelList = new List <PlaneTotalModel>(); foreach (var d in Plane) { PlaneTotalModel PlaneTotalModel = new PlaneTotalModel(); PlaneModel planeModel = new PlaneModel(); TotalModel totalModel = new TotalModel(); planeModel.Name = d.Name; planeModel.Duration = d.Duration; planeModel.Duration_No = d.Duration_No; planeModel.GST = d.GST; planeModel.GYM_ID = d.GYM_ID; planeModel.ID = d.ID; planeModel.Is_Active = d.Is_Active; planeModel.Worth = d.Worth; totalModel.Branch = db.Branch_Wise_Plane.Where(i => i.Plane_ID == d.ID && i.Status == true).Count(); PlaneTotalModel.TotalModel = totalModel; PlaneTotalModel.PlaneModel = planeModel; PlaneTotalModelList.Add(PlaneTotalModel); } return(View(PlaneTotalModelList)); } catch (Exception ex) { return(RedirectToAction("Contact", "Home")); } }
public async Task <ActionResult <PlaneModel> > PostPlaneModel(PlaneModel planeModel) { _context.PlaneModels.Add(planeModel); await _context.SaveChangesAsync(); return(RedirectToAction("GetPlaneModels")); }
public async Task <IActionResult> PutPlaneModel(int id, PlaneModel planeModel) { if (id != planeModel.Id) { return(BadRequest()); } _context.Entry(planeModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlaneModelExists(id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("GetPlaneModels")); }
private PlaneModel GetPlaneModelForAirConnection(PlaneModel planeModel) { while (true) { var userInput = communicator.AskUserForString( $"model samolotu, który ma obsługiwać to połączenie (obecnie {planeModel.Name})"); if (userInput == "") { break; } planeModel = planeModelService.GetPlaneModelByName(userInput); if (planeModel == null) { communicator.PrintWrongInputMessage(); } if (planeModel != null) { break; } } return(planeModel); }
/// <summary> /// constructor of the select planes window /// </summary> /// <param name="pc">the current reference cloud</param> /// <param name="pm">the plane models</param> public SelectPlanesWindow(PointCloud pc, List <PlaneModel> pm, DataManager.DataManager dm) { InitializeComponent(); _CancelTokenSource = new System.Threading.CancellationTokenSource(); pointCloud = pc; planeModelList = new List <PlaneModel>(); foreach (PlaneModel pl in pm) { planeModelList.Add(pl); if (pl.isFloor) { floorPlane = pl; } } refList = new List <PlaneModel>(); foreach (PlaneModel refpl in planeModelList) { refList.Add(refpl); } _DataManager = dm; UpdateListView(); }
private void HomePage_Loaded(object sender, RoutedEventArgs e) { try { // Binding this.avionList.DisplayMemberPath = "Libelle"; this.avionList.SelectedValuePath = "Id"; this.avionList.ItemsSource = PlaneModel.GetStopedPlanes(); this.incidentList.DisplayMemberPath = "Libelle"; this.incidentList.SelectedValuePath = "Id"; this.responsableList.DisplayMemberPath = "Name"; this.responsableList.SelectedValuePath = "Id"; List <Employee> employees = EmployeeModel.GetEmployees(); foreach (Employee employee in employees) { CheckBox c = new CheckBox(); c.FontSize = 18; c.Content = employee.Name; c.CommandParameter = employee.Id; c.Click += new RoutedEventHandler(CheckBoxValidated); this.StackEmploye.Children.Add(c); } } catch { } }
public ActionResult Month_Earning(Int64 ID) { try { var Plane = db.Students.Join(db.Fees, j => j.ID, u => u.Student_ID, (j, u) => new { Fees = u, Student = j }).Where(i => i.Student.Branch_ID == ID && i.Fees.Payment_Date.Value.Month == DateTime.Now.Month).ToList(); List <StudentFeePlaneModel> StudentFeePlaneModelList = new List <StudentFeePlaneModel>(); foreach (var d in Plane) { StudentFeePlaneModel StudentFeePlaneModel = new StudentFeePlaneModel(); StudentModel StudentModel = new StudentModel(); FeeModel feeModel = new FeeModel(); PlaneModel planeModel = new PlaneModel(); StudentModel.First_Name = d.Student.First_Name; StudentModel.Last_Name = d.Student.Last_Name; StudentModel.Email_ID = d.Student.Email_ID; StudentModel.Mobile = d.Student.Mobile; feeModel.Payment_Amount = d.Fees.Payment_Amount; var Plane_Name = db.Planes.Where(i => i.ID == d.Student.Current_Package_ID).FirstOrDefault(); planeModel.Name = Plane_Name.Name; StudentFeePlaneModel.StudentModel = StudentModel; StudentFeePlaneModel.FeeModel = feeModel; StudentFeePlaneModel.PlaneModel = planeModel; StudentFeePlaneModelList.Add(StudentFeePlaneModel); } return(View(StudentFeePlaneModelList)); } catch (Exception ex) { return(RedirectToAction("Contact", "Home")); } }
public void AddNewPlaneModel(PlaneModel planeModel) { using (var context = new SkySkannerContext()) { context.PlaneModels.Add(planeModel); context.SaveChanges(); } }
public PlaneModel Create(PlaneModel model) { var plane = _mapper.Map <Plane>(model); var createdPlane = _airportPlanesRepository.Create(plane); var result = _mapper.Map <PlaneModel>(createdPlane); return(result); }
/// <summary> /// sets or unsets a the floor plane /// </summary> private void _CheckboxFloorSelect_Checked(object sender, RoutedEventArgs e) { SelectPlanesListViewItem obj = ((FrameworkElement)sender).DataContext as SelectPlanesListViewItem; floorPlane = planeModelList.Find(pl => pl == obj.PlaneModel); UpdateListView(); }
public void SetUp() { repository = new PlaneModelRepository(new BoengServiceWebSiteContext()); plane = new PlaneModel() { Name = "Not Boeing", Description = "Totally not boeing", YearOfProd = DateTime.UtcNow }; PlaneRepository_CreatePlane(plane); }
public async Task <Guid> Update(PlaneModel planeModel) { var orderEntity = _mapper.Map <PlaneEntity>(planeModel); await _dbRepository.Update(orderEntity); await _dbRepository.SaveChangesAsync(); return(orderEntity.Id); }
public static PlaneContractsModel GetContractModel(PlaneModel model) { return(new PlaneContractsModel { Id = model.Id, Type = model.Type, MaxPassenger = model.MaxPassenger }); }
public void TearDown() { mapper = null; partRepository = null; plane = null; planeDto = null; userRepository = null; planeService = null; }
public DataGraphView() { this.vm = new DataGraphViewModel(PlaneModel.GetModel()); data = vm.Data; Correlative = vm.Correlative; InitializeComponent(); propertyToShow = 0; vm.PropertyChanged += ShowDataGraph; }
public FullJoyStickView() { vm = new FullJoyStickViewModel(PlaneModel.GetModel()); DataContext = vm; InitializeComponent(); // notify on change vm.PropertyChanged += RudderChanged; vm.PropertyChanged += ThrottleChanged; }
public TimeView() { this.vm = new TimeViewModel(PlaneModel.GetModel()); InitializeComponent(); DataContext = vm; // notify on change vm.PropertyChanged += TimeChanged; vm.PropertyChanged += UpdateTotalTime; }
public PlaneModel GetPlaneModelByName(string planeModelName) { PlaneModel planeModel = new PlaneModel(); using (var context = new SkySkannerContext()) { planeModel = context.PlaneModels.FirstOrDefault(x => x.Name.Equals(planeModelName)); } return(planeModel); //ten planeModel może być nullem, jeśli zostanie podany nieistniejący w bazie parametr planeModelName }
public PlanesEdit(ObservableCollection <AirlineModel> airlineList) { InitializeComponent(); Planes = new PlaneModel(); Data.DataContext = Planes; AirlineName.ItemsSource = airlineList; AirlineName.SelectedIndex = 0; Title.Content = "CREATION OF PLANE DATA"; OldData.Visibility = Visibility.Collapsed; }
public async Task <IActionResult> UpdateOrder([FromBody] PlaneModel plane) { var result = await _planeService.Update(plane); if (result == Guid.Empty) { return(BadRequest("Update failed")); } return(Ok(result)); }
static void Main(string[] args) { if (args.Any()) { var memoryMappedFileName = args[FILE_NAME_ARG_NUMBER]; var mutexName = args[MUTEX_ARG_NUMBER]; if (!string.IsNullOrEmpty(mutexName) && !string.IsNullOrEmpty(memoryMappedFileName)) { try { using (MemoryMappedFile mmf = MemoryMappedFile.OpenExisting(memoryMappedFileName)) { Mutex mutex = Mutex.OpenExisting(mutexName); mutex.WaitOne(); PlaneModel plane = null; using (MemoryMappedViewStream stream = mmf.CreateViewStream()) { BinaryReader reader = new BinaryReader(stream); var result = reader.ReadString(); plane = JsonConvert.DeserializeObject <PlaneModel>(result); } mutex.ReleaseMutex(); if (plane != null) { Console.WriteLine(Resources.PlaneNumberMsg, plane.Id); foreach (var point in plane.Path) { plane.CurrentLocation = point; mutex.WaitOne(); using (MemoryMappedViewStream stream = mmf.CreateViewStream()) { BinaryWriter writer = new BinaryWriter(stream); writer.Write(plane.CurrentLocation.JsonOut()); } mutex.ReleaseMutex(); Thread.Sleep(1000); Console.WriteLine(Resources.CurrentPositionMsg, point.lat, point.lng, point.alt); } } } Environment.Exit(0); } catch (FileNotFoundException) { Console.WriteLine(Resources.FileNotExistMsg); } } } }
public ActionResult AddPlaneModel(PlaneModel planeModel) { var isSuccess = PlaneRequests.AddPlaneModel(planeModel); if (!isSuccess || !ModelState.IsValid) { return(View("AddPlaneModel")); } return(RedirectToAction("AddPlane", "Planes")); }
public void SetUp() { mapper = new DtoProfile().GetMapper(); planeDto = new PlaneModelDto() { Id = 1, Name = "Boeing 777", Description = "Good Plane", YearOfProd = DateTime.UtcNow }; plane = mapper.Map <PlaneModel>(planeDto); partRepository = new Mock <IPlanePartRepository>(); userRepository = new Mock <IUserRepository>(); }
public PlanesEdit(PlaneModel plane, ObservableCollection <AirlineModel> airlineList) { InitializeComponent(); Planes = plane; PlaneOld = plane; Data.DataContext = Planes; AirlineName.ItemsSource = airlineList; AirlineName.SelectedIndex = airlineList.IndexOf(airlineList.Where(i => i.AirlineID == plane.AirlineID).First()); OldData.DataContext = PlaneOld; Title.Content = "UPDATE OF PLANE DATA"; }
public async Task <IActionResult> Create([FromBody] PlaneModel plane) { var result = await _planeService.Create(plane); if (result == Guid.Empty) { return(BadRequest()); } return(Ok(result)); }