Example #1
0
        /// <summary>
        /// 入力データをDBに登録
        /// </summary>
        private void SaveCountLimitDay()
        {
            DataTable dtCountLimitDay;
            DataRow   drCountLimitDay;

            dtCountLimitDay = clsDataTableControl.GetTable_CountLimitDay();
            drCountLimitDay = dtCountLimitDay.NewRow();

            // 既存データの削除
            clsDatabaseControl.DeleteCountLimitDay_Ward(pstrTargetWard);

            // データを登録(看護師)
            for (int iDayOfWeek = 1; iDayOfWeek <= 8; iDayOfWeek++)
            {
                drCountLimitDay["ward"]        = pstrTargetWard;
                drCountLimitDay["staff_kind"]  = "01";
                drCountLimitDay["day_of_week"] = String.Format("{0:D2}", iDayOfWeek);
                switch (String.Format("{0:D2}", iDayOfWeek))
                {
                case "01":
                    drCountLimitDay["day_min"]   = txtNurseMinDaySun.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightSun.Text;
                    break;

                case "02":
                    drCountLimitDay["day_min"]   = txtNurseMinDayMon.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightMon.Text;
                    break;

                case "03":
                    drCountLimitDay["day_min"]   = txtNurseMinDayTue.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightTue.Text;
                    break;

                case "04":
                    drCountLimitDay["day_min"]   = txtNurseMinDayWed.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightWed.Text;
                    break;

                case "05":
                    drCountLimitDay["day_min"]   = txtNurseMinDayThu.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightThu.Text;
                    break;

                case "06":
                    drCountLimitDay["day_min"]   = txtNurseMinDayFri.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightFri.Text;
                    break;

                case "07":
                    drCountLimitDay["day_min"]   = txtNurseMinDaySat.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightSat.Text;
                    break;

                case "08":
                    drCountLimitDay["day_min"]   = txtNurseMinDayHol.Text;
                    drCountLimitDay["night_max"] = txtNurseMaxNightHol.Text;
                    break;
                }

                clsDatabaseControl.InsertCountLimitDay(drCountLimitDay);
            }

            // データを登録(ケア)
            for (int iDayOfWeek = 1; iDayOfWeek <= 8; iDayOfWeek++)
            {
                drCountLimitDay["ward"]        = pstrTargetWard;
                drCountLimitDay["staff_kind"]  = "02";
                drCountLimitDay["day_of_week"] = String.Format("{0:D2}", iDayOfWeek);
                switch (String.Format("{0:D2}", iDayOfWeek))
                {
                case "01":
                    drCountLimitDay["day_min"]   = txtCareMinDaySun.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightSun.Text;
                    break;

                case "02":
                    drCountLimitDay["day_min"]   = txtCareMinDayMon.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightMon.Text;
                    break;

                case "03":
                    drCountLimitDay["day_min"]   = txtCareMinDayTue.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightTue.Text;
                    break;

                case "04":
                    drCountLimitDay["day_min"]   = txtCareMinDayWed.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightWed.Text;
                    break;

                case "05":
                    drCountLimitDay["day_min"]   = txtCareMinDayThu.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightThu.Text;
                    break;

                case "06":
                    drCountLimitDay["day_min"]   = txtCareMinDayFri.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightFri.Text;
                    break;

                case "07":
                    drCountLimitDay["day_min"]   = txtCareMinDaySat.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightSat.Text;
                    break;

                case "08":
                    drCountLimitDay["day_min"]   = txtCareMinDayHol.Text;
                    drCountLimitDay["night_max"] = txtCareMaxNightHol.Text;
                    break;
                }

                clsDatabaseControl.InsertCountLimitDay(drCountLimitDay);
            }
        }