Пример #1
0
 public Visas(VisaModel employee)
 {
     VisaViewModel.Errors = 0;
     InitializeComponent();
     Messenger.Default.Send <VisaModel>(employee);
     Messenger.Reset();
 }
Пример #2
0
 //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();
 }
Пример #3
0
        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());
        }
Пример #4
0
        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));
        }
Пример #5
0
        /// <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;
            }
        }