예제 #1
0
 /// <summary>
 /// Initialises conversation - adds a conversation to the data repository.
 /// </summary>
 /// <param name="tourAgent">Who is the conversation to be started with</param>
 /// <param name="title">short description of conversation</param>
 public ConversationModel(TourAgentModel tourAgent, string title)
 {
     try
     {
         CurrentUser = SessionHandler.UserDetails;
         BuildDataParameters(tourAgent, title);
         SendDataRequest("usp_AddConversation");
         Validate();
         PopulateProperties();
     }
     catch (Exception e)
     {
         throw new TouristTalkException("Error initialising conversation using details", e);
     }
 }
예제 #2
0
 /// <summary>
 ///  Builds data paramenters for sending data request for adding Conversation
 /// </summary>
 /// <param name="tourAgent">Who is the conversation to be started with</param>
 /// <param name="title">short description of conversation</param>
 protected void BuildDataParameters(TourAgentModel tourAgent, string title)
 {
     try
     {
         Dictionary <string, object> parameters = new Dictionary <string, object>()
         {
             { "UserID", CurrentUser.UserID },
             { "TourAgentID ", tourAgent.ID },
             { "Title", title },
         };
         _dataRequestParameters = parameters;
     }
     catch (Exception e)
     {
         throw new TouristTalkException("Exception trying to build parameters for adding a conversation", e);
     }
 }