コード例 #1
0
 public void AddNewMessage(MessageFromCompanyModel messageModel)
 {
     try
     {
         MessageDAL.AddNewMessage(messageModel);
     }
     catch (Exception e)
     {
     }
 }
コード例 #2
0
 public void AddNewMessageToBuliding(MessageFromCompanyModel messageModel)
 {
     try
     {
         MessageDAL messageDAL = new MessageDAL();
         messageDAL.AddNewMessage(messageModel);
     }
     catch (Exception e)
     {
     }
 }
コード例 #3
0
 public void AddNewMessage(MessageFromCompanyModel messageModel)
 {
     try
     {
         MessageDAL messageDAL = new MessageDAL();
         messageDAL.AddNewMessage(messageModel);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #4
0
        public void AddNewMessageTest()
        {
            MessageFromCompanyModel model = new MessageFromCompanyModel();

            model.Subject = "TestMessage";
            model.Text    = "TestValue";
            CompanyDAL companyDAL = new CompanyDAL();

            model.CompanyId = companyDAL.GetCompanies().Select(x => x.Id).Min();
            MessageDAL messageDAL = new MessageDAL();

            messageDAL.AddNewMessage(model);
            MessageFromCompanyModel testmodel = messageDAL.GetMessagesByCompany(model.CompanyId).Where(x => x.Subject == "TestMessage" && x.Text == "TestValue").FirstOrDefault();

            Assert.That(testmodel != null, Is.True);
        }