public List <string> SelectApplication_unit_name()
        {
            Application_unit_Model application_unit_Model = new Application_unit_Model();
            List <string>          application_units      = application_unit_Model.SelectApplication_unit_name();

            return(application_units);
        }
        public void SelectApplication_unit_byApplication_unit(string application_unit)
        {
            Application_unit_Model application_Unit_Model = new Application_unit_Model();

            application_Unit_Model.SelectApplication_unit_byApplication_unit(application_unit);
            Application_unit_no = application_Unit_Model.Application_unit_no;
            Application_unit    = application_Unit_Model.Application_unit;
            Group = application_Unit_Model.Group;
            Application_phone_no = application_Unit_Model.Application_phone_no;
            Principal            = application_Unit_Model.Principal;
            Principal_phone_no   = application_Unit_Model.Principal_phone_no;
            Application_address  = application_Unit_Model.Application_address;
            Work_content         = application_Unit_Model.Work_content;
            Total_volunteers     = application_Unit_Model.Total_volunteers;

            Unit_volunteer_list_Model        unit_Volunteer_List_Model  = new Unit_volunteer_list_Model();
            List <Unit_volunteer_list_Model> unit_Volunteer_List_Models = unit_Volunteer_List_Model.Selectvolunteer_list_byApplication_unit(application_Unit_Model.Application_unit_no);
            List <Volunteer_List>            tmp_Volunteer_Lists        = new List <Volunteer_List>();

            foreach (var row in unit_Volunteer_List_Models)
            {
                Volunteer_List volunteer_List = new Volunteer_List();
                volunteer_List.Chinese_name      = row.Chinese_name;
                volunteer_List.English_name      = row.English_name;
                volunteer_List.Sex               = row.Sex;
                volunteer_List.Birthday          = row.Birthday;
                volunteer_List.IDcrad_no         = row.IDcrad_no;
                volunteer_List.Medical_record_no = row.Medical_record_no;
                volunteer_List.Identity_type     = row.Identity_type;
                volunteer_List.Seniority         = row.Seniority;
                volunteer_List.Vest_no           = row.Vest_no;
                volunteer_List.Education         = row.Education;

                tmp_Volunteer_Lists.Add(volunteer_List);
            }
            Volunteer_Lists = tmp_Volunteer_Lists;

            Unit_expertise_Model unit_Expertise_Model = new Unit_expertise_Model();
            List <string>        unit_Expertises      = unit_Expertise_Model.SelectUnit_ExpertisebyApplication_unit_no(application_Unit_Model.Application_unit_no);
            List <string>        tmp_expertises       = new List <string>();

            foreach (var row in unit_Expertises)
            {
                tmp_expertises.Add(row);
            }
            Expertises = tmp_expertises;

            Unit_service_period_Model        unit_Service_Period_Model = new Unit_service_period_Model();
            List <Unit_service_period_Model> unit_Service_Periods      = unit_Service_Period_Model.SelectUnit_service_period_byApplication_unit_no(application_Unit_Model.Application_unit_no);
            List <Unit_service_period>       tmp_Service_Periods       = new List <Unit_service_period>();

            foreach (var row in unit_Service_Periods)
            {
                Unit_service_period unit_Service_Period = new Unit_service_period();
                unit_Service_Period.Service_period   = row.Service_period;
                unit_Service_Period.Volunteer_number = row.Volunteer_number;
                tmp_Service_Periods.Add(unit_Service_Period);
            }
            Service_Periods = tmp_Service_Periods;
        }
Beispiel #3
0
        public void CommitApplication_unit(string Commit_type, Application_unit_data_ViewModel application_Unit_Data_ViewModel, List <string> Insert_list, List <string> Delete_list, List <Unit_service_period> Insert_Service_Periods, List <Unit_service_period> Delete_Service_Periods)
        {
            Application_unit_Model    application_Unit_Model    = new Application_unit_Model();
            Unit_expertise_Model      unit_Expertise_Model      = new Unit_expertise_Model();
            Unit_service_period_Model unit_Service_Period_Model = new Unit_service_period_Model();

            if (application_Unit_Data_ViewModel.Application_unit_no > 0)
            {
                application_Unit_Model.Application_unit_no = application_Unit_Data_ViewModel.Application_unit_no;
            }
            application_Unit_Model.Application_unit     = application_Unit_Data_ViewModel.Application_unit;
            application_Unit_Model.Group                = application_Unit_Data_ViewModel.Group;
            application_Unit_Model.Application_phone_no = application_Unit_Data_ViewModel.Application_phone_no;
            application_Unit_Model.Application_address  = application_Unit_Data_ViewModel.Application_address;
            application_Unit_Model.Principal            = application_Unit_Data_ViewModel.Principal;
            application_Unit_Model.Principal_phone_no   = application_Unit_Data_ViewModel.Principal_phone_no;
            application_Unit_Model.Work_content         = application_Unit_Data_ViewModel.Work_content;

            List <Unit_service_period_Model> Insert_sp = new List <Unit_service_period_Model>();

            foreach (var row in Insert_Service_Periods)
            {
                Unit_service_period_Model Insert_Model = new Unit_service_period_Model();
                Insert_Model.Service_period   = row.Service_period;
                Insert_Model.Volunteer_number = row.Volunteer_number;
                Insert_sp.Add(Insert_Model);
            }
            List <Unit_service_period_Model> Delete_sp = new List <Unit_service_period_Model>();

            foreach (var row in Delete_Service_Periods)
            {
                Unit_service_period_Model Delete_Model = new Unit_service_period_Model();
                Delete_Model.Service_period   = row.Service_period;
                Delete_Model.Volunteer_number = row.Volunteer_number;
                Delete_sp.Add(Delete_Model);
            }

            switch (Commit_type)
            {
            case "新增":
                application_Unit_Model.InsertApplication_unit(application_Unit_Model);
                break;

            case "修改":
                application_Unit_Model.UpdateApplication_unit(application_Unit_Model);
                unit_Expertise_Model.DeleteUnit_Expertise(application_Unit_Model.Application_unit_no, Delete_list);
                unit_Service_Period_Model.DeleteUnit_service_period(application_Unit_Model.Application_unit_no, Delete_sp);
                break;
            }
            ;

            unit_Service_Period_Model.InsertUnit_service_period(application_Unit_Model.Application_unit_no, Insert_sp);
            unit_Expertise_Model.InsertUnit_Expertise(application_Unit_Model.Application_unit_no, Insert_list);
        }
Beispiel #4
0
        public List <string> SelectApplication_unit_Name()
        {
            Application_unit_Model application_Unit_Model = new Application_unit_Model();
            List <string>          Application_units      = new List <string>();

            foreach (var row in application_Unit_Model.SelectApplication_unit_name())
            {
                Application_units.Add(row);
            }

            return(Application_units);
        }
        public List <Shift_schedule_ViewModel> SelectApplication_unit()
        {
            Application_unit_Model          application_Unit_Model = new Application_unit_Model();
            List <Shift_schedule_ViewModel> Shift_schedules        = new List <Shift_schedule_ViewModel>();

            foreach (var row in application_Unit_Model.SelectApplication_unit())
            {
                Shift_schedule_ViewModel shift_Schedule_ViewModel = new Shift_schedule_ViewModel();
                shift_Schedule_ViewModel.Application_unit_no = row.Application_unit_no;
                shift_Schedule_ViewModel.Application_unit    = row.Application_unit;

                Shift_schedules.Add(shift_Schedule_ViewModel);
            }

            return(Shift_schedules);
        }
        public List <Application_unit_ViewModel> SelectApplication_unit(string name, string group_name, int membersmin, int membersmax)
        {
            Application_unit_Model            application_Unit_Model      = new Application_unit_Model();
            List <Application_unit_Model>     Application_unit_Models     = application_Unit_Model.SelectApplication_unit(name, group_name, membersmin, membersmax);
            List <Application_unit_ViewModel> application_Unit_ViewModels = new List <Application_unit_ViewModel>();

            foreach (var row in Application_unit_Models)
            {
                Application_unit_ViewModel application_Unit_ViewModel = new Application_unit_ViewModel();
                application_Unit_ViewModel.Application_unit_no = row.Application_unit_no;
                application_Unit_ViewModel.Application_unit    = row.Application_unit;
                application_Unit_ViewModel.Group = row.Group;
                application_Unit_ViewModel.Application_phone_no = row.Application_phone_no;
                application_Unit_ViewModel.Principal            = row.Principal;
                application_Unit_ViewModel.Principal_phone_no   = row.Principal_phone_no;
                application_Unit_ViewModel.Application_address  = row.Application_address;
                application_Unit_ViewModel.Work_content         = row.Work_content;
                application_Unit_ViewModel.Total_volunteers     = row.Total_volunteers;

                application_Unit_ViewModels.Add(application_Unit_ViewModel);
            }

            return(application_Unit_ViewModels);
        }