Exemplo n.º 1
0
 public void DeleteForm(string keyValue)
 {
     if (service.Count(m => m.F_ParentId, m => m.F_ParentId == keyValue) > 0)
     {
         throw new Exception("删除失败!操作的对象包含了下级数据。");
     }
     else
     {
         service.Delete(m => m.F_Id == keyValue);
     }
 }
Exemplo n.º 2
0
 public void DeleteForm(string keyValue)
 {
     if (service.IQueryable().Count(t => t.F_ParentId.Equals(keyValue)) > 0)
     {
         throw new Exception("删除失败!操作的对象包含了下级数据。");
     }
     else
     {
         service.Delete(t => t.F_Id == keyValue);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 删除一个组织信息
        /// </summary>
        /// <param name="keyValue"></param>
        public void DeleteForm(string keyValue)
        {
            ResultClass <List <OrganizeEntity> > _ret = service.FindList(new OrganizeEntity()
            {
                F_ParentId = keyValue
            });

            if (!_ret.Result)
            {
                service.Delete(t => t.F_Id == keyValue);
                return;
            }
            throw new Exception("删除失败!操作的对象包含了下级数据。");
        }
Exemplo n.º 4
0
        public void DeleteForm(string keyValue, bool isAdmin = false)
        {
            if (service.IQueryable().Count(t => t.F_ParentId.Equals(keyValue)) > 0)
            {
                throw new Exception("删除失败!操作的对象包含了下级数据。");
            }
            var organize = GetForm(keyValue);

            if (organize.F_AllowDelete == false && !isAdmin)
            {
                throw new Exception("删除失败!此机构不允许删除。");
            }
            service.Delete(t => t.F_Id == keyValue);
        }
Exemplo n.º 5
0
        public void DeleteForm(string keyValue)
        {
            OperatorModel op = OperatorProvider.Provider.GetCurrent();

            if (service.IQueryable <Sys_Organize>().Count(t => t.F_ParentId.Equals(keyValue)) > 0)
            {
                throw new Exception("删除失败!操作的对象包含了下级数据。");
            }
            else
            {
                var F_FullName = service.FindEntity <Sys_Organize>(m => m.F_Id == keyValue).F_FullName;
                LogHelper.Info("机构:【" + F_FullName + "】删除!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Code.Enum.OpType.System, null, "", "", ViewLevel.Admin);
                service.Delete <Sys_Organize>(t => t.F_Id == keyValue);
            }
        }
Exemplo n.º 6
0
 public void DeleteForm(string keyValue)
 {
     if (service.IQueryable().Count(t => t.F_ParentId.Equals(keyValue)) > 0)
     {
         throw new Exception("删除失败!操作的对象包含了下级数据。");
     }
     else
     {
         service.Delete(t => t.F_Id == keyValue);
         try
         {
             //添加日志
             LogMess.addLog(DbLogType.Delete.ToString(), "删除成功", "删除组织机构信息【" + GetForm(keyValue).F_FullName + "】成功!");
         }
         catch { }
     }
 }
Exemplo n.º 7
0
 public void Delete(OrganizeEntity entity)
 {
     service.Delete(entity);
 }