Пример #1
0
        public List <Shift_schedule_detail_ViewModel> SelectVolunteer_byName(string name, int application_unit_no, int service_period_no)
        {
            Volunteer_Model volunteer_Model = new Volunteer_Model();
            List <Shift_schedule_detail_ViewModel> Schedule_Detail_ViewModels = new List <Shift_schedule_detail_ViewModel>();

            foreach (var row in volunteer_Model.SelectVolunteer_byName(name, application_unit_no, service_period_no))
            {
                Shift_schedule_detail_ViewModel shift_Schedule_Detail_ViewModel = new Shift_schedule_detail_ViewModel();
                shift_Schedule_Detail_ViewModel.Volunteer_no       = int.Parse(row.Volunteer_no);
                shift_Schedule_Detail_ViewModel.Chinese_name       = row.Chinese_name;
                shift_Schedule_Detail_ViewModel.Identity_type_name = row.Identity_type;
                shift_Schedule_Detail_ViewModel.Order = row.Wish_order;
                shift_Schedule_Detail_ViewModel.Photo = row._Photo;

                Schedule_Detail_ViewModels.Add(shift_Schedule_Detail_ViewModel);
            }

            return(Schedule_Detail_ViewModels);
        }
Пример #2
0
        public void SelectVolunteer_byvolunteer_name(string name)
        {
            Volunteer_Model volunteer_Model = new Volunteer_Model();

            foreach (var row in volunteer_Model.SelectVolunteer_byName(name))
            {
                this.Volunteer_no = int.Parse(row.Volunteer_no);
                this.Volunteer    = row.Chinese_name;
                if (!string.IsNullOrEmpty(row.Mobile_no))
                {
                    this.Phone = row.Mobile_no;
                }
                else
                {
                    this.Phone = row.Phone_no;
                }

                break;
            }
        }