예제 #1
0
 public ActionResult <IEnumerable <string> > PostCreateCompany([FromBody] CompanyDataDTO companyDataDTO)
 {
     try
     {
         var      company        = CompanyDAO.CreateCompany(companyDataDTO);
         var      account        = companyDataDTO.AccountDTO;
         var      messageAccount = new MessageAccount(company.CompanyId, account.Fullname, account.Email, 2);
         Producer producer       = new Producer();
         producer.PublishMessage(message: JsonConvert.SerializeObject(messageAccount), "AccountGenerate");
         return(new JsonResult(rm.Success("Save success")));
     } catch
     {
         return(new JsonResult(rm.Error("Save fail")));
     }
 }