public Application_unit_View()
        {
            InitializeComponent();

            Application_unit_ViewModel application_Unit_ViewModel = new Application_unit_ViewModel();
            List <string> service_groups = application_Unit_ViewModel.Selectservice_group();

            this.cbb_group.ItemsSource = service_groups;
        }
Exemplo n.º 2
0
        public Application_unitdata_View(string type)
        {
            InitializeComponent();

            g_type = type;
            Application_unit_ViewModel application_Unit_ViewModel = new Application_unit_ViewModel();
            List <string> service_groups = application_Unit_ViewModel.Selectservice_group();

            this.ccb_group.ItemsSource        = service_groups;
            this.lab_total_volunteers.Content = "0";
        }
        private void btn_selectApplication_unit_Click(object sender, RoutedEventArgs e)
        {
            string name      = this.nametext.Text;
            string group     = this.cbb_group.Text;
            int    membermin = 0;
            int    membermax = 0;

            if (this.members_10.IsChecked == true)
            {
                membermin = 1;
                membermax = 10;
            }
            if (this.members_20.IsChecked == true)
            {
                membermin = 11;
                membermax = 20;
            }
            if (this.members_30.IsChecked == true)
            {
                membermin = 21;
                membermax = 30;
            }
            if (this.members_40.IsChecked == true)
            {
                membermin = 31;
                membermax = 40;
            }
            if (this.members_40up.IsChecked == true)
            {
                membermin = 41;
                membermax = 0;
            }

            Application_unit_ViewModel                   application_Unit_ViewModel  = new Application_unit_ViewModel();
            List <Application_unit_ViewModel>            Application_unit_ViewModels = application_Unit_ViewModel.SelectApplication_unit(name, group, membermin, membermax);
            ObservableCollection <application_Unit_list> application_Unit_lists      = new ObservableCollection <application_Unit_list>();

            foreach (var row in Application_unit_ViewModels)
            {
                application_Unit_lists.Add(new application_Unit_list()
                {
                    運用單位     = row.Application_unit,
                    組別       = row.Group,
                    運用單位聯絡電話 = row.Application_phone_no,
                    負責人      = row.Principal,
                    負責人聯絡電話  = row.Principal_phone_no,
                    志工總人數    = row.Total_volunteers
                });
            }

            this.dg_Application_unit.ItemsSource = application_Unit_lists;
        }
Exemplo n.º 4
0
        public Application_unitdata_View(string type, string application_unit)
        {
            InitializeComponent();

            g_type = type;
            Application_unit_ViewModel application_Unit_ViewModel = new Application_unit_ViewModel();
            List <string> service_groups = application_Unit_ViewModel.Selectservice_group();

            this.ccb_group.ItemsSource = service_groups;

            Application_unit_data_ViewModel application_Unit_Data_ViewModel = new Application_unit_data_ViewModel();

            application_Unit_Data_ViewModel.SelectApplication_unit_byApplication_unit(application_unit);
            unit_num = application_Unit_Data_ViewModel.Application_unit_no;
            this.txt_application_unit.Text       = application_Unit_Data_ViewModel.Application_unit;
            this.ccb_group.SelectedValue         = application_Unit_Data_ViewModel.Group.Trim();
            this.txt_application_unit_phone.Text = application_Unit_Data_ViewModel.Application_phone_no;
            this.txt_principal.Text           = application_Unit_Data_ViewModel.Principal;
            this.txt_principal_phone.Text     = application_Unit_Data_ViewModel.Principal_phone_no;
            this.txt_application_address.Text = application_Unit_Data_ViewModel.Application_address;
            this.lab_total_volunteers.Content = application_Unit_Data_ViewModel.Total_volunteers;
            this.txt_work_content.Text        = application_Unit_Data_ViewModel.Work_content;

            if (application_Unit_Data_ViewModel.Service_Periods.Count > 0)
            {
                foreach (var row in application_Unit_Data_ViewModel.Service_Periods)
                {
                    if (row.Service_period.Contains("週一"))
                    {
                        if (row.Service_period.Contains("上午"))
                        {
                            this.Mon_am.Text = row.Volunteer_number;
                        }
                        else if (row.Service_period.Contains("下午"))
                        {
                            this.Mon_pm.Text = row.Volunteer_number;
                        }
                        else
                        {
                            this.Mon_night.Text = row.Volunteer_number;
                        }
                    }

                    if (row.Service_period.Contains("週二"))
                    {
                        if (row.Service_period.Contains("上午"))
                        {
                            this.Tue_am.Text = row.Volunteer_number;
                        }
                        else if (row.Service_period.Contains("下午"))
                        {
                            this.Tue_pm.Text = row.Volunteer_number;
                        }
                        else
                        {
                            this.Tue_night.Text = row.Volunteer_number;
                        }
                    }

                    if (row.Service_period.Contains("週三"))
                    {
                        if (row.Service_period.Contains("上午"))
                        {
                            this.Wed_am.Text = row.Volunteer_number;
                        }
                        else if (row.Service_period.Contains("下午"))
                        {
                            this.Wed_pm.Text = row.Volunteer_number;
                        }
                        else
                        {
                            this.Wed_night.Text = row.Volunteer_number;
                        }
                    }

                    if (row.Service_period.Contains("週四"))
                    {
                        if (row.Service_period.Contains("上午"))
                        {
                            this.Thu_am.Text = row.Volunteer_number;
                        }
                        else if (row.Service_period.Contains("下午"))
                        {
                            this.Thu_pm.Text = row.Volunteer_number;
                        }
                        else
                        {
                            this.Thu_night.Text = row.Volunteer_number;
                        }
                    }

                    if (row.Service_period.Contains("週五"))
                    {
                        if (row.Service_period.Contains("上午"))
                        {
                            this.Fri_am.Text = row.Volunteer_number;
                        }
                        else if (row.Service_period.Contains("下午"))
                        {
                            this.Fri_pm.Text = row.Volunteer_number;
                        }
                        else
                        {
                            this.Fri_night.Text = row.Volunteer_number;
                        }
                    }

                    if (row.Service_period.Contains("週六"))
                    {
                        if (row.Service_period.Contains("上午"))
                        {
                            this.Sat_am.Text = row.Volunteer_number;
                        }
                        else
                        {
                            this.Sat_pm.Text = row.Volunteer_number;
                        }
                    }

                    if (row.Service_period.Contains("週日"))
                    {
                        if (row.Service_period.Contains("上午"))
                        {
                            this.Sun_am.Text = row.Volunteer_number;
                        }
                        else
                        {
                            this.Sun_pm.Text = row.Volunteer_number;
                        }
                    }
                }
            }

            ObservableCollection <Unit_volunteer_list> Unit_volunteer_lists = new ObservableCollection <Unit_volunteer_list>();

            if (application_Unit_Data_ViewModel.Volunteer_Lists.Count > 0)
            {
                foreach (var row in application_Unit_Data_ViewModel.Volunteer_Lists)
                {
                    Unit_volunteer_lists.Add(new Unit_volunteer_list()
                    {
                        中文姓名   = row.Chinese_name,
                        英文姓名   = row.English_name,
                        性別     = row.Sex,
                        生日     = row.Birthday,
                        身分證字號  = row.IDcrad_no,
                        病歷號    = row.Medical_record_no,
                        身分類別   = row.Identity_type,
                        年資     = row.Seniority,
                        志工背心號碼 = row.Vest_no,
                        學歷     = row.Education
                    });
                }
                this.dg_volunteer_lists.ItemsSource = Unit_volunteer_lists;
            }

            Insert_Service_Periods.Clear();
        }
Exemplo n.º 5
0
        public Application_unit_detail_View(string Application_unit)
        {
            InitializeComponent();

            Application_unit_ViewModel application_Unit_ViewModel = new Application_unit_ViewModel();

            application_Unit_ViewModel.SelectApplication_unit_byApplication_unit(Application_unit);
            this.Lab_application_unit.Content       = application_Unit_ViewModel.Application_unit;
            this.Lab_application_unit_phone.Content = application_Unit_ViewModel.Application_phone_no;
            this.Lab_group.Content               = application_Unit_ViewModel.Group;
            this.Lab_principal.Content           = application_Unit_ViewModel.Principal;
            this.Lab_principal_phone.Content     = application_Unit_ViewModel.Principal_phone_no;
            this.Lab_application_address.Content = application_Unit_ViewModel.Application_address;
            this.Lab_work_content.Content        = application_Unit_ViewModel.Work_content;
            this.Lab_total_volunteers.Content    = application_Unit_ViewModel.Total_volunteers;

            string str_expertise = null;

            foreach (var row in application_Unit_ViewModel.Expertises)
            {
                str_expertise += row + ", ";
            }
            this.Lab_expertise.Content = str_expertise;

            foreach (var row in application_Unit_ViewModel.Service_Periods)
            {
                if (row.Service_period.Contains("週一"))
                {
                    if (row.Service_period.Contains("上午"))
                    {
                        this.Mon_am.Content = row.Volunteer_number;
                    }
                    else if (row.Service_period.Contains("下午"))
                    {
                        this.Mon_pm.Content = row.Volunteer_number;
                    }
                    else
                    {
                        this.Mon_night.Content = row.Volunteer_number;
                    }
                }

                if (row.Service_period.Contains("週二"))
                {
                    if (row.Service_period.Contains("上午"))
                    {
                        this.Tue_am.Content = row.Volunteer_number;
                    }
                    else if (row.Service_period.Contains("下午"))
                    {
                        this.Tue_pm.Content = row.Volunteer_number;
                    }
                    else
                    {
                        this.Tue_night.Content = row.Volunteer_number;
                    }
                }

                if (row.Service_period.Contains("週三"))
                {
                    if (row.Service_period.Contains("上午"))
                    {
                        this.Wed_am.Content = row.Volunteer_number;
                    }
                    else if (row.Service_period.Contains("下午"))
                    {
                        this.Wed_pm.Content = row.Volunteer_number;
                    }
                    else
                    {
                        this.Wed_night.Content = row.Volunteer_number;
                    }
                }

                if (row.Service_period.Contains("週四"))
                {
                    if (row.Service_period.Contains("上午"))
                    {
                        this.Thu_am.Content = row.Volunteer_number;
                    }
                    else if (row.Service_period.Contains("下午"))
                    {
                        this.Thu_pm.Content = row.Volunteer_number;
                    }
                    else
                    {
                        this.Thu_night.Content = row.Volunteer_number;
                    }
                }

                if (row.Service_period.Contains("週五"))
                {
                    if (row.Service_period.Contains("上午"))
                    {
                        this.Fri_am.Content = row.Volunteer_number;
                    }
                    else if (row.Service_period.Contains("下午"))
                    {
                        this.Fri_pm.Content = row.Volunteer_number;
                    }
                    else
                    {
                        this.Fri_night.Content = row.Volunteer_number;
                    }
                }

                if (row.Service_period.Contains("週六"))
                {
                    if (row.Service_period.Contains("上午"))
                    {
                        this.Sat_am.Content = row.Volunteer_number;
                    }
                    else
                    {
                        this.Sat_pm.Content = row.Volunteer_number;
                    }
                }

                if (row.Service_period.Contains("週日"))
                {
                    if (row.Service_period.Contains("上午"))
                    {
                        this.Sun_am.Content = row.Volunteer_number;
                    }
                    else
                    {
                        this.Sun_pm.Content = row.Volunteer_number;
                    }
                }
            }

            ObservableCollection <Unit_volunteer_list> Unit_volunteer_lists = new ObservableCollection <Unit_volunteer_list>();

            foreach (var row in application_Unit_ViewModel.Volunteer_Lists)
            {
                Unit_volunteer_lists.Add(new Unit_volunteer_list()
                {
                    中文姓名   = row.Chinese_name,
                    英文姓名   = row.English_name,
                    性別     = row.Sex,
                    生日     = row.Birthday,
                    身分證字號  = row.IDcrad_no,
                    病歷號    = row.Medical_record_no,
                    身分類別   = row.Identity_type,
                    年資     = row.Seniority,
                    志工背心號碼 = row.Vest_no,
                    學歷     = row.Education
                });
            }

            this.dg_volunteer_list.ItemsSource = Unit_volunteer_lists;
        }