Exemplo n.º 1
0
 public IActionResult Detail(int id)
 {
     try
     {
         var kvrr = _kvrrService.GetKVRRById(id);
         return(View(kvrr));
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id)
        {
            try
            {
                var mark = await _kvrrMarkService.GetKVRRMarkById(id);

                if (mark == null)
                {
                    throw new NotFoundException();
                }

                var kvrrs      = new List <KVRRModel>();
                var kvrrUnUser = await _kvrrService.GetKVRRMarkUnUse();

                if (mark.KVRRId == null || mark.KVRRId == 0)
                {
                    kvrrs.Add(new KVRRModel {
                        Id = 0, Name = Model.Resources.Common.KVRRType
                    });
                }
                else
                {
                    var currentKVRR = _kvrrService.GetKVRRById(mark.KVRRId);
                    if (currentKVRR == null)
                    {
                        throw new NotFoundException();
                    }
                    kvrrs.Add(currentKVRR);
                }
                kvrrs.AddRange(kvrrUnUser);
                ViewBag.KVRRSelectList = kvrrs;
                return(View("Edit", mark));
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }