public List <Shift_schedule_detail_ViewModel> SelectVolunteer_byIdentity_type(string Identity_type, 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_byIdentity_type(Identity_type, application_unit_no, service_period_no)) { Shift_schedule_detail_ViewModel Schedule_Detail_ViewModel = new Shift_schedule_detail_ViewModel(); Schedule_Detail_ViewModel.Volunteer_no = int.Parse(row.Volunteer_no); Schedule_Detail_ViewModel.Chinese_name = row.Chinese_name; Schedule_Detail_ViewModel.Identity_type_name = row.Identity_type; Schedule_Detail_ViewModel.Photo = row._Photo; Schedule_Detail_ViewModel.Order = row.Wish_order; Schedule_Detail_ViewModels.Add(Schedule_Detail_ViewModel); } return(Schedule_Detail_ViewModels); }
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; } }
//方法,從model取資料================================================================================================== public List <Volunteer_ViewModel> Search_Volunteer(string Name1, string Group1, string Expertise1, List <int> years) { //建立等等回傳 List <Volunteer_ViewModel> the_get = new List <Volunteer_ViewModel>(); Volunteer_Model volunteer = new Volunteer_Model(); List <Volunteer_Model> volunteer_Models = volunteer.Search_Volunteer(Name1, Group1, Expertise1, years); foreach (var item in volunteer_Models) { Volunteer_ViewModel _ViewModel = new Volunteer_ViewModel(); _ViewModel.Volunteer_no = item.Volunteer_no; _ViewModel.Chinese_name = item.Chinese_name; _ViewModel.English_name = item.English_name; _ViewModel.Sex = item.Sex; _ViewModel.Birthday = item.Birthday; _ViewModel.IDcrad_no = item.IDcrad_no; _ViewModel.Medical_record_no = item.Medical_record_no; _ViewModel.Identity_type = item.Identity_type; _ViewModel.Seniority = item.Seniority; _ViewModel.Join_date = item.Join_date; _ViewModel.Leave_date = item.Leave_date; _ViewModel.Leave_reason = item.Leave_reason; _ViewModel.Phone_no = item.Phone_no; _ViewModel.Mobile_no = item.Mobile_no; _ViewModel.Vest_no = item.Vest_no; _ViewModel.Postal_code = item.Postal_code; _ViewModel.Address = item.Address; _ViewModel.Education = item.Education; _ViewModel.Lssuing_unit_no = item.Lssuing_unit_no; _ViewModel.Service_manual_no = item.Service_manual_no; _ViewModel.Personality_scale = item.Personality_scale; _ViewModel.VLT_experise = item.VLT_experise; _ViewModel.VLT_group = item.VLT_group; the_get.Add(_ViewModel); } return(the_get); }