示例#1
0
 public PagedResponse <Condominium> List([FromQuery] CondominiumSearchParams searchParams)
 {
     return(new PagedResponse <Condominium>
     {
         Values = CondominiumService.List(searchParams.ToModel()),
         MorePages = false
     });
 }
示例#2
0
 public ActionResult <ObjectResult> UpdateCardData([FromBody] CardData cardData)
 {
     try
     {
         CondominiumService condominiumService = new CondominiumService(Startup.BeePlaceDataBaseConnectionString);
         condominiumService.UpdateCardData(cardData);
         return(StatusCode((int)HttpStatusCode.OK, cardData));
     }
     catch (Exception e)
     {
         return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
     }
 }
示例#3
0
 public ActionResult <ObjectResult> InsertManager([FromBody] CondominiumManager condominiumManager)
 {
     try
     {
         CondominiumService condominiumService = new CondominiumService(Startup.BeePlaceDataBaseConnectionString);
         condominiumService.InsertManager(condominiumManager);
         return(StatusCode((int)HttpStatusCode.OK, condominiumManager));
     }
     catch (Exception e)
     {
         return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
     }
 }
示例#4
0
 public ActionResult <ObjectResult> Validate(string cnpj)
 {
     try
     {
         CondominiumService condominiumService = new CondominiumService(Startup.BeePlaceDataBaseConnectionString);
         var condominium = condominiumService.Validate(cnpj);
         return(StatusCode((int)HttpStatusCode.OK, condominium));
     }
     catch (Exception e)
     {
         return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
     }
 }
示例#5
0
 public ActionResult <ObjectResult> GetCondominium(int idCondominium)
 {
     try
     {
         CondominiumService condominiumService = new CondominiumService(Startup.BeePlaceDataBaseConnectionString);
         var condominium = condominiumService.GetCondominium(new Condominium()
         {
             Id = idCondominium
         });
         return(StatusCode((int)HttpStatusCode.OK, condominium));
     }
     catch (Exception e)
     {
         return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
     }
 }
示例#6
0
 public Condominium Patch([FromBody] Condominium condominium)
 {
     return(CondominiumService.Update(condominium));
 }
示例#7
0
 public Condominium Post([FromBody] Condominium condominium)
 {
     return(CondominiumService.Create(condominium));
 }
示例#8
0
 public Condominium Get([FromRoute] int id)
 {
     return(CondominiumService.Get(id));
 }
示例#9
0
 public CondominiumController(CondominiumService condominiumService, AccountingService accountingService)
 {
     CondominiumService = condominiumService;
     AccountingService  = accountingService;
 }