Пример #1
0
 private void butSaveMailSend_Click(object sender, EventArgs e)
 {
     try
     {
         SoundIntConfig model = BuilModel();
         if (model != null)
         {
             int result = 0;
             if (idConfig == 0)
             {
                 result = soundIntConfigDAO.AddObj(model);
             }
             else
             {
                 result = soundIntConfigDAO.UpdateObj(model);
             }
             if (result > 0)
             {
                 MessageBox.Show("Lưu dữ liệu thành công.");
                 LoadDataToGridView();
                 idConfig = 0;
                 ClearInput();
                 EnableControlSend(true, false, false, false, false);
                 EnableInputMSend(false);
             }
             else
             {
                 MessageBox.Show("Lưu dữ liệu thất bại.");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi: " + ex.Message);
     }
 }