예제 #1
0
        private bool CheckStudentNumberFromServiceAsync(string StudentNo)
        {
            try
            {
                var service = WebServices.AllStudentService();
                AllStudentsList_Filter        filter  = new AllStudentsList_Filter();
                List <AllStudentsList_Filter> filters = new List <AllStudentsList_Filter>();
                filter.Field    = AllStudentsList_Fields.Status;
                filter.Criteria = "Current";
                filters.Add(filter);

                AllStudentsList[] allStudents = service.ReadMultiple(filters.ToArray(), null, 0);

                return(allStudents.Where(x => x.No == StudentNo).Any());
            }
            catch (Exception ex)
            {
                ViewBag.errorMessage = ex.Message;
                return(false);
            }
        }