示例#1
0
        public ChangeLogForm(TableAdapter pTableAdapter)
        {
            if (!pTableAdapter.AutoLog)
            {
                throw new Exception(string.Format("Entidade {0} não controla log", pTableAdapter.TableName));
            }
            _tableAdapter = new TableAdapterLog(pTableAdapter);

            InitializeComponent();
            InitilizeForm();
            SetEvents();
        }
示例#2
0
 /// <summary>
 /// Hablita Log automático no tableAdapter
 /// </summary>
 public void SetAutoLog(bool autoLog = true)
 {
     if (autoLog)
     {
         TableAdapterLog = new TableAdapterLog(this);
         this.AutoLog    = autoLog;
     }
     else if (TableAdapterLog != null)
     {
         TableAdapterLog.Detach();
         TableAdapterLog = null;
     }
 }