public Visas(VisaModel employee) { VisaViewModel.Errors = 0; InitializeComponent(); Messenger.Default.Send <VisaModel>(employee); Messenger.Reset(); }
//public VisaDetail() //{ // VisaDetailViewModel.Errors = 0; // InitializeComponent(); //} //public VisaDetail(EmployeeDTO employee) //{ // VisaDetailViewModel.Errors = 0; // InitializeComponent(); // Messenger.Default.Send<EmployeeDTO>(employee); // Messenger.Reset(); //} public VisaDetail(VisaModel visa) { VisaDetailViewModel.Errors = 0; InitializeComponent(); Messenger.Default.Send<VisaModel>(visa); Messenger.Reset(); }
public async Task <IActionResult> PutVisa(int id, VisaModel visaModel) { if (id != visaModel.Id) { return(BadRequest()); } var visa = await _context.Visas.FindAsync(id); _mapper.Map(visaModel, visa); try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VisaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <VisaModel> > PostVisa(VisaModel visaModel) { var visa = _mapper.Map <Visa>(visaModel); _context.Visas.Add(visa); await _context.SaveChangesAsync(); return(CreatedAtAction("GetVisa", new { id = visa.Id }, visaModel)); }
/// <summary> /// Add record in Vendor Package Relationship Table. /// </summary> /// <param name="record">The Model</param> /// <returns> /// Vendor id from vendor Package Relationship Table. /// </returns> /// <exception cref="ArgumentNullException">Vendor</exception> public async Task <int?> UpdateVisaMasterAsync(VisaModel record) { try { if (record == null) { throw new ArgumentNullException("Visa"); } return(await this.visaRespository.UpdateAsync(record)); } catch (Exception ex) { throw ex; } }