示例#1
0
        /// <summary>
        /// 获取logo
        /// </summary>
        /// <param name="CompanyId"></param>
        /// <returns></returns>
        public string getLogo(int CompanyId)
        {
            SysWebSetting s = _dal.GetWebSetting(CompanyId);

            if (s != null)
            {
                if (string.IsNullOrEmpty(s.LoginLogo))
                {
                    return("");
                }
                return("/SysImg/" + CompanyId + "/" + s.LoginLogo);
            }
            else
            {
                return("");
            }
        }
示例#2
0
        //[SysPermissionValidate(Code = Sys.SysConstLimits.系统管理_基本配置)]
        public ActionResult WebSetting()
        {
            var model = AutofacDependencyResolver.Current.GetService <ISysWebSettingRepository>().GetWebSetting();

            if (model == null)
            {
                //OpResult op = null;
                //var comp = Authorize.GetCompanyByConnect(ref op);
                //var name = comp == null ? "" : comp.Title;
                var name = "";
                model = new SysWebSetting()
                {
                    LogoDispWay = 1, SysName = name
                };
            }
            return(View(model));
        }
示例#3
0
        /// <summary>
        /// 更新基本配置信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public OpResult SaveWebSetting(SysWebSetting model)
        {
            var result = OpResult.Fail("数据保存失败!");

            try
            {
                model.CompanyId = Sys.SysCommonRules.CompanyId;
                if (_dal.SaveOrUpdate(model))
                {
                    result = OpResult.Success("数据保存成功");
                }
            }
            catch (Exception ex)
            {
                result = OpResult.Fail("数据保存失败!" + ex.Message);
            }
            return(result);
        }
示例#4
0
        //[SysPermissionValidate(Code = Sys.SysConstLimits.系统管理_基本配置)]
        public ActionResult WebSetting(SysWebSetting model)
        {
            var relativePath = "";
            var path         = FileHelper.SaveLogoPath(ref relativePath, Services.SysUserService.CurrentUser.CompanyId.ToString());

            if (Request.Files["LoginLogo"] != null && Request.Files["LoginLogo"].ContentLength != 0)
            {
                var    topLogo     = Request.Files["LoginLogo"];
                var    topLogoName = "logo_login.png";
                string fullname    = path + topLogoName;
                topLogo.SaveAs(fullname);
                model.LoginLogo = topLogoName;
            }
            if (Request.Files["TopLogo"] != null && Request.Files["TopLogo"].ContentLength != 0)
            {
                var    topLogo     = Request.Files["TopLogo"];
                var    topLogoName = "logo_top.png";
                string fullname    = path + topLogoName;
                topLogo.SaveAs(fullname);
                model.TopLogo = topLogoName;
            }
            if (Request.Files["hidBottomLogo"] != null && Request.Files["hidBottomLogo"].ContentLength != 0)
            {
                var    bottomLogo     = Request.Files["hidBottomLogo"];
                var    bottomLogoName = "logo_bottom.png";
                string fullname       = path + bottomLogoName;
                bottomLogo.SaveAs(fullname);
                model.BottomLogo = bottomLogoName;
            }
            var result = new OperateResult();

            if (Request.Files["hidAppIcon640"] != null && Request.Files["hidAppIcon640"].ContentLength != 0)
            {
                var    appIcon     = Request.Files["hidAppIcon640"];
                var    appIconName = "logo_app_icon_640.png";
                string fullname    = path + appIconName;
                appIcon.SaveAs(fullname);
                model.AppIcon640 = appIconName;
            }
            if (Request.Files["hidAppIcon960"] != null && Request.Files["hidAppIcon960"].ContentLength != 0)
            {
                var    appIcon     = Request.Files["hidAppIcon960"];
                var    appIconName = "logo_app_icon_960.png";
                string fullname    = path + appIconName;
                appIcon.SaveAs(fullname);
                model.AppIcon960 = appIconName;
            }
            if (Request.Files["hidAppIndexIcon640"] != null && Request.Files["hidAppIndexIcon640"].ContentLength != 0)
            {
                var    appIcon     = Request.Files["hidAppIndexIcon640"];
                var    appIconName = "logo_app_index_640.png";
                string fullname    = path + appIconName;
                appIcon.SaveAs(fullname);
                model.AppIndexIcon640 = appIconName;
            }
            if (Request.Files["hidAppIndexIcon960"] != null && Request.Files["hidAppIndexIcon960"].ContentLength != 0)
            {
                var    appIcon     = Request.Files["hidAppIndexIcon960"];
                var    appIconName = "logo_app_index_960.png";
                string fullname    = path + appIconName;
                appIcon.SaveAs(fullname);
                model.AppIndexIcon960 = appIconName;
            }
            if (Request.Files["hidAppCustomer640"] != null && Request.Files["hidAppCustomer640"].ContentLength != 0)
            {
                var    appCustomer     = Request.Files["hidAppCustomer640"];
                var    appCustomerName = "app_index_customer_640.png";
                string fullname        = path + appCustomerName;
                appCustomer.SaveAs(fullname);
                model.AppCustomer640 = appCustomerName;
            }
            if (Request.Files["hidAppCustomer960"] != null && Request.Files["hidAppCustomer960"].ContentLength != 0)
            {
                var    appCustomer     = Request.Files["hidAppCustomer960"];
                var    appCustomerName = "app_index_customer_960.png";
                string fullname        = path + appCustomerName;
                appCustomer.SaveAs(fullname);
                model.AppCustomer960 = appCustomerName;
            }
            if (Request.Files["hidAppIndexbg640"] != null && Request.Files["hidAppIndexbg640"].ContentLength != 0)
            {
                var    appCustomer     = Request.Files["hidAppIndexbg640"];
                var    appCustomerName = "app_index_bg_640.png";
                string fullname        = path + appCustomerName;
                appCustomer.SaveAs(fullname);
                model.AppIndexbg640 = appCustomerName;
            }
            if (Request.Files["hidAppIndexbg960"] != null && Request.Files["hidAppIndexbg960"].ContentLength != 0)
            {
                var    appCustomer     = Request.Files["hidAppIndexbg960"];
                var    appCustomerName = "app_index_bg_960.png";
                string fullname        = path + appCustomerName;
                appCustomer.SaveAs(fullname);
                model.AppIndexbg960 = appCustomerName;
            }
            if (Request.Files["hidSysIcon"] != null && Request.Files["hidSysIcon"].ContentLength != 0)
            {
                var rootPath    = FileHelper.GetRoot;
                var sysIconPath = System.IO.Path.Combine(rootPath);

                var    sysIcon     = Request.Files["hidSysIcon"];
                var    sysIconName = "favicon.ico";
                string fullname    = sysIconPath + sysIconName;
                sysIcon.SaveAs(fullname);
                model.SysIcon = sysIconName;
            }
            if (result.Message.IsNullOrEmpty())
            {
                AutofacDependencyResolver.Current.GetService <ISysWebSettingRepository>().AddOrUpdate(model);
            }
            return(this.ToJsonOperateResult());
        }