protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (Request["id"] != null) { CurrentGroup = Group.Get(Convert.ToInt32(Request["id"])); } if (CurrentGroup == null) { CurrentGroup = new Group(GroupType.None, ""); } switch (CurrentGroup.Type) { case GroupType.System: PageTitle = "ϵͳ�û���"; CurrentAdminRights = SysAdminRights.ConvertFromString(CurrentGroup.Rights) as SysAdminRights; break; case GroupType.Supplier: PageTitle = "��Ӧ���û���"; CurrentSupplierRights = SupplierRights.ConvertFromString(CurrentGroup.Rights) as SupplierRights; break; default: PageTitle = "�û���"; break; } if (IsPost) { switch (AjaxAction) { case "SysGroupPage.saverights": SaveGroupRights(); break; case "SysGroupPage.save": SaveGroup(); break; } } }
public static GroupRights ConvertFromString(string rights) { if (String.IsNullOrEmpty(rights)) { return Default; } string[] rs = rights.Split(GroupRights.RIGHTS_SPLITER); if (rs.Length != 7) { return Default; } SysAdminRights r = new SysAdminRights(); r.allowSysSetting = rs[0] == "1"; r.allowTemplateManage = rs[1] == "1"; r.allowUserManage = rs[2] == "1"; r.allowLibManage = rs[3] == "1"; r.allowLeadCateManage = rs[4] == "1"; r.allowLeadManage = rs[5] == "1"; r.allowFinanceManage = rs[6] == "1"; return r; }