Example #1
0
        private void InsertHistory()
        {
            if (!_drTable.Table.Columns.Contains("sysMenuID"))
            {
                return;
            }
            string     sysMenuID = _drTable["sysMenuID"].ToString();
            string     action    = "Xem";
            SysHistory sh        = new SysHistory();

            sh.InsertHistory(sysMenuID, action, string.Empty, string.Empty);
        }
Example #2
0
        protected void InsertHistory(DataAction dataAction, DataSet dsDataCopy)
        {
            if (!_drTable.Table.Columns.Contains("sysMenuID"))
            {
                return;
            }
            string sysMenuID = _drTable["sysMenuID"].ToString();
            string action = string.Empty, content = string.Empty, pkValue = string.Empty;

            switch (dataAction)
            {
            case DataAction.Insert:
                action = "Mới";
                string pk = _dataType == DataType.MasterDetail ? _drTableMaster["Pk"].ToString() : _drTable["Pk"].ToString();
                pkValue = _drCurrentMaster != null ? _drCurrentMaster[pk].ToString() : string.Empty;
                break;

            case DataAction.Update:
                action  = "Sửa";
                content = GetContentForHistory(dsDataCopy, ref pkValue);
                break;

            case DataAction.Delete:
                action  = "Xóa";
                content = GetContentForHistory(dsDataCopy, ref pkValue);
                break;

            case DataAction.IUD:
                action  = "Xem";
                content = GetContentForHistory(dsDataCopy, ref pkValue);
                break;
            }
            SysHistory sh = new SysHistory();

            sh.InsertHistory(sysMenuID, action, pkValue, content);
        }