Exemplo n.º 1
0
        public MessageReport DeleteById(string id)
        {
            var report = new MessageReport(false, "Có lỗi xảy ra");

            try
            {
                var objDelete = _MenuFunctionRepository.GetById(id);
                if (objDelete != null)
                {
                    objDelete.IsDeleted = true;
                    _MenuFunctionRepository.Update(objDelete);
                    Save();

                    //Update BreadCrumb
                    UpdateBreadCrumb(objDelete, "add");

                    report = new MessageReport(true, "Xóa thành công");
                }
            }
            catch (Exception ex)
            {
                report = new MessageReport(false, ex.Message);
            }

            _LogService.WriteLog(report, "MenuFunction", id, ActionConfig.Delete, user);

            return(report);
        }
Exemplo n.º 2
0
        public bool Update(MenuFunction obj)
        {
            bool isSuccess = false;

            try
            {
                _MenuFunctionRepository.Update(obj);
                Save();
                isSuccess = true;

                //Update BreadCrumb
                UpdateBreadCrumb(obj, "update");
            }
            catch (Exception ex)
            {
                isSuccess = false;
                throw ex;
            }
            return(isSuccess);
        }