Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
 public Supplier()
     : base()
 {
     faxNumber = "";
     foundedYear = 1900;
     serviceAreas = "";
     categories = "";
     categoryLeadsNums = "";
     industries = "";
     matchMode = SupplierMatchMode.Manual;
     rights = SupplierRights.Default;
 }
Ejemplo n.º 3
0
        public static GroupRights ConvertFromString(string rights)
        {
            SupplierRights r = new SupplierRights();
            if (String.IsNullOrEmpty(rights))
            {
                return Default;
            }
            string[] rs = rights.Split(GroupRights.RIGHTS_SPLITER);
            if (rs.Length != 20)
            {
                return Default;
            }

            r.allowEditInfo = rs[0] == "1";
            r.allowEditCatesAndAreas = rs[1] == "1";
            r.allowAllCates = rs[2] == "1";
            r.allowAllAreas = rs[3] == "1";
            r.allowAllIndus = rs[4] == "1";

            r.maxCategoryCount = Convert.ToUInt16(rs[5]);
            r.maxAreaCount = Convert.ToUInt16(rs[6]);
            r.maxIndustryCount = Convert.ToUInt16(rs[7]);

            r.areasRestriction = Convert.ToSingle(rs[8]);

            r.catesRestriction = Convert.ToSingle(rs[9]);

            r.indusRestriction = Convert.ToSingle(rs[10]);

            r.allowInviteEvaluation = rs[11] == "1";
            r.allowUploadCert = rs[12] == "1";
            r.allowEditMinisite = rs[13] == "1";
            r.allowListBillings = rs[14] == "1";
            r.allowListLeads = rs[15] == "1";
            r.allowChangeLeadStatus = rs[16] == "1";
            r.allowAddCase = rs[17] == "1";
            r.allowUpdateCase = rs[18] == "1";
            r.allowDeleteCase = rs[19] == "1";
            return r;
        }