     let calenderbuttonnamearray = ["../images/backday.png","../images/nextday.png"]
     
     var currentnsdate = NSDate()        //MonthlySalaryShowがデータ表示している日付を管理
+    var AAA: [String] = []
     
     override func viewDidLoad() {
         super.viewDidLoad()

                    for textField:UITextField in textFields! {
                        //各textにアクセス
//                        print(textField.text)
                    }
                    
                    self.appDelegate.errorshiftname.removeValueForKey(keys)

                    if(self.appDelegate.errorshiftname.count != 0){
                        self.AlertShow()
                    }
                }

        
        
        self.presentViewController(alert, animated: true, completion: nil)
    }
    
    //受け取ったテキストからShiftSystemDBのレコードを生成して返す関数
    func CreateShiftSystemDBRecord(shiftname: String, shiftgroup: String, shifttime: String) -> ShiftSystemDB{
        let record = ShiftSystemDB()
        var gid = 0
        var start = 0.0
        var end = 0.0
        
        switch(shiftgroup){
        case "早番":
            gid = 0
            
        case "中1":
            gid = 1
            
        case "中2":
            gid = 2
            
        case "中3":
            gid = 3
            
        case "遅番":
            gid = 4
            
        default:    //その他
            gid = 5
        }
        
        if(shifttime == "なし"){
            start = 0.0
            end = 0.0
        }else{
            var AAA = ""
            var index = shifttime.startIndex
            var timearray: [Double] = []
            
            for(var i = 0; i < 1; i++){
                while(shifttime[index] != ":"){
                    AAA += String(shifttime[index])
                    index = index.successor()
                }
                
                let hour = Double(AAA)
                index = index.successor()
                AAA = ""

                while(shifttime[index] != " "){
                    AAA += String(shifttime[index])
                    index = index.successor()
                }
                
                let minute = Double(AAA)! / 60.0

                timearray.append(hour! + minute)
                
            }

            start = timearray[0]
//            end = timearray[1]
        }
        
        record.id = DBmethod().DBRecordCount(ShiftSystemDB)
        record.name = shiftname
        record.groupid = gid
        record.starttime = start
        record.endtime = end
        
        print(record)
        return record
    }
    
    //並行処理で使用
