示例#1
0
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            var version = System.Configuration.ConfigurationManager.AppSettings["Ver"];

            ViewBag.version = version;
            var tid = requestContext.HttpContext.Request.Params["tid"];

            if (!string.IsNullOrEmpty(tid))
            {
                CurrentTenant = _tenants.Find(p => p.TenantId == int.Parse(tid));
                ViewBag.tid   = tid;
            }
            base.Initialize(requestContext);
        }
示例#2
0
        public ActionResult SaveBaseInfo(RetechWing.Models.SysTenant tenant, string permissionIds)
        {
            if (tenant.TenantId == 0)
            {
                tenant.CreateTime = DateTime.Now;
                tenant.CreateUser = CurrentAdmin.AdminId;
                tenant.JoinTime   = DateTime.Now;
                tenant.Status     = 0;
                tenant.Icon       = "/Content/favicon.ico";
                _tenantManager.AddTenant(tenant);
                _tenants.Add(tenant);
            }
            else
            {
                var old = _tenants.First(p => p.TenantId == tenant.TenantId);
                old.ComName         = tenant.ComName;
                old.DomainName      = tenant.DomainName;
                old.TenantName      = tenant.TenantName;
                old.TenantDesc      = tenant.TenantDesc;
                old.ExpiredTime     = tenant.ExpiredTime;
                old.MaxRegister     = tenant.MaxRegister;
                old.SkinName        = tenant.SkinName;
                old.IpAddress       = tenant.IpAddress;
                old.IsAllow         = tenant.IsAllow;
                old.MaxFailureCount = tenant.MaxFailureCount;
                old.SiteTitle       = tenant.SiteTitle;
                old.LockTime        = tenant.LockTime;
                tenant.Icon         = "/Content/favicon.ico";
                //old.Logo = tenant.Logo;
                _tenantManager.UpdateTenant(old);
            }
            var ids = permissionIds.GetArray();

            _tenantManager.SaveTenantPermissions(tenant.TenantId, ids);
            return(Json(new { result = 1, msg = RetechWing.LanguageResources.Exam.Exampaper.SaveSuccess }, JsonRequestBehavior.DenyGet));
        }