Exemplo n.º 1
0
        /// <summary>
        /// 增加 角色
        /// </summary>
        public static AjaxResult AddRole(NameValueCollection form)
        {
            var entity = new CFRole();

            entity.Load(form);
            SysLogHelper.AddLog(SysContext.CurrentUserName, "添加权限ID:" + entity.RoleName, "添加-权限");
            return(DB.InsertEntity <CFRole>(entity));
        }
Exemplo n.º 2
0
        public static AjaxResult RemoveCorps(string ID)
        {
            CorporationHelper helper = new CorporationHelper();

            if (helper.IsCorporationInUsed(ID))
            {
                return(AjaxResult.Error("该使用单位已经注册印章,无法删除!"));
            }
            else
            {
                helper.DeleteCorporation(ID);
                SysLogHelper.AddLog(SysContext.CurrentUserName, "删除企业信息ID:" + ID, "删除-企业信息");
                return(AjaxResult.Success());
            }
        }
Exemplo n.º 3
0
        public static AjaxResult RemoveRent(string ID)
        {
            RentInfoHelper helper = new RentInfoHelper();

            if (helper.IsExists(ID))
            {
                return(AjaxResult.Error("该房源已经有租赁信息,无法删除!"));
            }
            else
            {
                helper.DeleteCorporation(ID);
                SysLogHelper.AddLog(SysContext.CurrentUserName, "删除房源信息ID:" + ID, "删除-房源信息");
                return(AjaxResult.Success());
            }
        }
Exemplo n.º 4
0
 public static AjaxResult AddGeneralCode(string group, string id, string name, string status)
 {
     try
     {
         SignetBaseInfoManager manager = new SignetBaseInfoManager();
         if (manager.ExistsGeneralCode(group, name))
         {
             return(AjaxResult.Error("此通用数据已经存在,请重新输入!"));
         }
         else
         {
             manager.AddGeneralCode(group, id, name);
             SysLogHelper.AddLog(SysContext.CurrentUserName, "添加通用数据(" + group + ")ID:" + id, "添加-通用数据");
             return(AjaxResult.Success());
         }
     }
     catch (Exception ex)
     {
         return(AjaxResult.Error(ex.Message));
     }
 }
Exemplo n.º 5
0
        //public static AjaxResult RemoveRegister(string ID)
        //{
        //    try
        //    {
        //        SignetBaseInfoManager manager = new SignetBaseInfoManager();
        //        SignetHelper helper = new SignetHelper();
        //        if (helper.IsExistsRegister(ID))
        //        {
        //            return AjaxResult.Error("此区域编码已在使用中,无法删除!");
        //        }
        //        else
        //        {
        //            manager.DeleteRegister(ID);
        //            SysLogHelper.AddLog(SysContext.CurrentUserName, "删除登记区域ID:" + ID, "删除-登记区域");
        //            return AjaxResult.Success();
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        return AjaxResult.Error(ex.Message);
        //    }
        //}

        //public static AjaxResult AddRegister(string ID,string Name,string Manager,string Address,string Phone)
        //{
        //    try
        //    {
        //        SignetBaseInfoManager manager = new SignetBaseInfoManager();
        //        if (manager.ExistsRegister(ID))
        //        {
        //            return AjaxResult.Error("此备案区域编号已经存在,请重新输入!");
        //        }
        //        else
        //        {
        //            manager.AddRegister(ID, Name, Manager, Address, Phone, string.Empty, string.Empty);
        //            SysLogHelper.AddLog(SysContext.CurrentUserName, "添加登记区域ID:" + ID, "添加-登记区域");
        //            return AjaxResult.Success();
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        return AjaxResult.Error(ex.Message);
        //    }
        //}

        //public static AjaxResult UpdateRegister(string ID, string Name, string Manager, string Address, string Phone)
        //{
        //    try
        //    {
        //        SignetBaseInfoManager manager = new SignetBaseInfoManager();
        //            manager.UpdateRegisters(ID, Name, Manager, Address, Phone, string.Empty, string.Empty);
        //            return AjaxResult.Success();
        //    }
        //    catch (Exception ex)
        //    {
        //        return AjaxResult.Error(ex.Message);
        //    }
        //}

        #endregion

        #region General Code
        public static AjaxResult RemoveGeneralCode(string group, string ID)
        {
            try
            {
                SignetHelper helper = new SignetHelper();
                if (helper.IsCodeInUsing(group, ID))
                {
                    return(AjaxResult.Error("该编码已在使用中,无法进行删除!"));
                }
                else
                {
                    SignetBaseInfoManager manager = new SignetBaseInfoManager();
                    manager.DeleteGeneralCode(group, ID);
                    SysLogHelper.AddLog(SysContext.CurrentUserName, "删除通用数据(" + group + ")ID:" + ID, "删除-通用数据");
                    return(AjaxResult.Success());
                }
            }
            catch (Exception ex)
            {
                return(AjaxResult.Error(ex.Message));
            }
        }