예제 #1
0
        public bool Kingdom_CreateKingdom()
        {
            return(true);

            KingdomService.CreateKingdomRequest request = new KingdomService.CreateKingdomRequest()
            {
                Name = "unit test kingdom", AttendanceCreditMinimum = 9, AttendanceMinimum = 6, AveragePeriod = 6, Token = LoginAsAdmin(), AttendancePeriodType = "month"
            };
            KingdomService.StatusType response = kingdomsvc.CreateKingdom(request);

            if (response.Status == 0 && int.Parse(response.Detail) > 0)
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        public bool Kingdom_Waffle()
        {
            KingdomService.WaffleKingdomRequest wrequest = new KingdomService.WaffleKingdomRequest()
            {
                KingdomId = 1, Token = LoginAsAdmin()
            };
            KingdomService.StatusType wresponse = kingdomsvc.RetireKingdom(wrequest);

            if (wresponse.Status == 0)
            {
                wresponse = kingdomsvc.RestoreKingdom(wrequest);
                if (wresponse.Status == 0)
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #3
0
        public bool Kingdom_SetKingdomDetails()
        {
            KingdomService.GetKingdomDetailsRequest gkrequest = new KingdomService.GetKingdomDetailsRequest()
            {
                KingdomId = 1
            };
            KingdomService.GetKingdomDetailsResponse gkresponse = kingdomsvc.GetKingdomDetails(gkrequest);

            if (gkresponse.Status.Status == 0 && gkresponse.KingdomInfo.KingdomId == 1 && gkresponse.KingdomConfiguration.Length > 0)
            {
                string abbr = gkresponse.KingdomInfo.Abbreviation;
                KingdomService.ConfigurationEditItemType kc = new KingdomService.ConfigurationEditItemType();
                foreach (var config in gkresponse.KingdomConfiguration)
                {
                    if ("AttendanceMinimum" == config.Key)
                    {
                        kc.Action          = "Edit";
                        kc.ConfigurationId = config.ConfigurationId;
                        kc.Key             = config.Key;
                        kc.Value           = "6";
                    }
                }
                KingdomService.SetKingdomDetailsRequest skrequest = new KingdomService.SetKingdomDetailsRequest()
                {
                    Token                = LoginAsKingdomPM(),
                    KingdomId            = 1,
                    Abbreviation         = "M2",
                    KingdomConfiguration = new KingdomService.ConfigurationEditItemType[1] {
                        kc
                    }
                };
                KingdomService.StatusType skresponse = kingdomsvc.SetKingdomDetails(skrequest);
                if (skresponse.Status == 0)
                {
                    return(true);
                }
            }
            return(false);
        }