예제 #1
0
        public ActionResult <DeleteScheduleTargetResponse> Post(DeleteScheduleTarget request)
        {
            if (request.Schedules == null || request.Schedules.Length == 0)
            {
                return(BadRequest("Schedules array is empty."));
            }
            if (request.Attributes == null || request.Attributes.Length == 0)
            {
                return(BadRequest("Attributes array is empty."));
            }
            List <GXScheduleToAttribute> list = new List <GXScheduleToAttribute>();

            foreach (UInt64 s in request.Schedules)
            {
                foreach (UInt64 o in request.Attributes)
                {
                    list.Add(new GXScheduleToAttribute()
                    {
                        ScheduleId = s, AttributeId = o
                    });
                }
            }
            host.Connection.Delete(GXDeleteArgs.DeleteRange(list));
            host.SetChange(TargetType.Schedule, DateTime.Now);
            return(new DeleteScheduleTargetResponse());
        }
예제 #2
0
        public ActionResult <DeleteScheduleTargetResponse> Post(DeleteScheduleTarget request)
        {
            List <GXScheduleToAttribute> list = new List <GXScheduleToAttribute>();

            foreach (UInt64 s in request.Schedules)
            {
                foreach (UInt64 o in request.Attributes)
                {
                    list.Add(new GXScheduleToAttribute()
                    {
                        ScheduleId = s, AttributeId = o
                    });
                }
            }
            host.Connection.Delete(GXDeleteArgs.DeleteRange(list));
            host.SetChange(TargetType.Schedule, DateTime.Now);
            return(new DeleteScheduleTargetResponse());
        }