예제 #1
0
 protected void ChangeMessage(WndMessage msg)
 {
     if (msg != null)
     {
         _message = msg;
         InitControls();
     }
 }
예제 #2
0
 public async Task <bool> SendAsync(IApiMsg msg)
 {
     return(await Task.Run(async() =>
     {
         await Task.Delay(2500);
         return true;
     }));
 }
예제 #3
0
        protected void ChangeMessage()
        {
            var frm = new FrmMessageList(Enums.FrmMode.Select);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                _message = frm.SelectedMsg;
                InitControls();
            }
        }
예제 #4
0
        protected virtual void Initialize()
        {
            _service = new MessageService();

            if (_message == null)
            {
                _message = new WndMessage();
            }

            InitControls();
        }
예제 #5
0
 public async Task <int> RemoveAsync(IApiMsg msg)
 {
     try
     {
         _connection.Open();
         return(await _connection.ExecuteAsync(RemoveQuery(), new
         {
             msg.Id
         }));
     }
     finally
     {
         _connection.Close();
     }
 }
예제 #6
0
 public int Remove(IApiMsg msg)
 {
     try
     {
         _connection.Open();
         return(_connection.Execute(RemoveQuery(), new
         {
             msg.Id
         }));
     }
     finally
     {
         _connection.Close();
     }
 }
예제 #7
0
 public async Task <int> UpdateAsync(IApiMsg msg)
 {
     try
     {
         _connection.Open();
         return(await _connection.ExecuteAsync(UpdateQuery(), new
         {
             msg.Content,
             msg.Favorite,
             msg.IconName,
             msg.NeedConfirm,
             msg.Duration,
             msg.Id
         }));
     }
     finally
     {
         _connection.Close();
     }
 }
예제 #8
0
 public int Update(IApiMsg msg)
 {
     try
     {
         _connection.Open();
         return(_connection.Execute(UpdateQuery(), new
         {
             msg.Content,
             msg.Favorite,
             msg.IconName,
             msg.NeedConfirm,
             msg.Duration,
             msg.Id
         }));
     }
     finally
     {
         _connection.Close();
     }
 }
예제 #9
0
        public async Task AddAsync(IApiMsg msg)
        {
            try
            {
                _connection.Open();
                await _connection.ExecuteAsync(InsertQuery(), new
                {
                    msg.Content,
                    msg.Favorite,
                    msg.IconName,
                    msg.NeedConfirm,
                    msg.Duration
                });

                msg.Id = (int)_connection.LastInsertRowId;
            }
            finally
            {
                _connection.Close();
            }
        }
예제 #10
0
 public bool Send(IApiMsg msg)
 {
     throw new NotImplementedException();
 }
예제 #11
0
 public FrmMessageEdit(IApiMsg message)
     : this()
 {
     _message = message;
 }