public ActionResult Create(PaymentOrderCreateInput input)
 {
     if (!ModelState.IsValid) return View(input);
     if (input.AgreementId.HasValue)
     {
         s.CreateForAgreement(v.BuildEntity(input), input.AgreementId.Value);
         return Json(new{Id = input.AgreementId.Value, type = 'a' });
     }
     if (input.ContractId.HasValue) {
         s.CreateForContract(v.BuildEntity(input), input.ContractId.Value);
         return Json(new {Id = input.ContractId.Value, type = 'c'});
     }
     throw new InvalidOperationException("imposibil de creat ordin de plata");
 }
Exemplo n.º 2
0
 public ActionResult Create(PaymentOrderCreateInput input)
 {
     if (!ModelState.IsValid)
     {
         return(View(input));
     }
     if (input.AgreementId.HasValue)
     {
         s.CreateForAgreement(v.BuildEntity(input), input.AgreementId.Value);
         return(Json(new{ Id = input.AgreementId.Value, type = 'a' }));
     }
     if (input.ContractId.HasValue)
     {
         s.CreateForContract(v.BuildEntity(input), input.ContractId.Value);
         return(Json(new { Id = input.ContractId.Value, type = 'c' }));
     }
     throw new InvalidOperationException("imposibil de creat ordin de plata");
 }