public async Task <IActionResult> AddVoy(int?id) { var company = await _datacontext.Companies.FindAsync(id); if (id == null || company == null) { return(NotFound()); } var model = new VoysViewModel { Company_id = company.Id, Employee_list = _combosHelper.GetComboEmployees(), Port_list = _combosHelper.GetComboPorts(), Vessel_list = _combosHelper.GetComboVessels(), }; return(View(model)); }
public async Task <IActionResult> Assing(int?id) { if (id == null) { return(NotFound()); } var agenda = await _dataContext.Agendas .FirstOrDefaultAsync(o => o.Id == id.Value); if (agenda == null) { return(NotFound()); } var model = new AgendaViewModel { Id = agenda.Id, Employees = _combosHelper.GetComboEmployees(), Labours = _combosHelper.GetComboLabours(0) }; return(View(model)); }
public VoysViewModel ToVoyViewModel(Voy voy) { return(new VoysViewModel { Account = voy.Account, Altitude = voy.Altitude, Cargo = voy.Cargo, Cargo_Charterer = voy.Cargo_Charterer, Company_id = voy.Company.Id, Consignee = voy.Consignee, Contract = voy.Contract, Employ_id = voy.Employee.Id, Employee_list = _combosHelper.GetComboEmployees(), Id = voy.Id, Eta = voy.EtaLocal, Etb = voy.EtbLocal, Etc = voy.EtcLocal, Etd = voy.EtdLocal, Facility = voy.Facility, LastKnowPosition = voy.LastKnowPosition, Latitude = voy.Latitude, Laycan = voy.Laycan, Opinions = voy.Opinions, Owner_Charterer = voy.Owner_Charterer, Pod = voy.Pod, Pol = voy.Pol, Port_id = voy.Port.Id, Port_list = _combosHelper.GetComboPorts(), Sf = voy.Sf, Shipper = voy.Shipper, Statuses = voy.Statuses, Vessel_id = voy.Vessel.Id, Vessel_list = _combosHelper.GetComboVessels(), Voyimages = voy.Voyimages, Voy_number = voy.Voy_number, }); }