private static void OtherAttend() { //寫入交接班資料 OtherAttendChangeInfo otherAttendInfo = new OtherAttendChangeInfo() { NOBR = "K001017", ADATE = "2019-06-02", BDATE = "2019-06-02", EDATE = "2019-06-02", BTIME = "1200", ETIME = "1400", ATYPE = "HO", USEMIN = 60, KEY_MAN = "5", NOTE = "5" }; IAttendanceService attendanceService = new AttendanceServiceClient(); Object Introduction = attendanceService.CheckOtherAttendData(otherAttendInfo); string json = JsonConvert.SerializeObject(Introduction); Console.WriteLine(json.ToString()); //List<OtherAttendChangeInfo> otherAttendChangeInfosList = new List<OtherAttendChangeInfo>() //{ // new OtherAttendChangeInfo{ // NOBR = "H000001", // ADATE = "2020/07/29", // BDATE = "2020/07/29", // EDATE = "2020/07/29", // BTIME = "1234", // ETIME = "2000", // ATYPE = "交接班", // USEMIN = 1, // KEY_MAN = "1", // NOTE = "1" // }, // new OtherAttendChangeInfo{ // NOBR = "H000001", // ADATE = "2020/07/29", // BDATE = "2020/07/29", // EDATE = "2020/07/29", // BTIME = "2000", // ETIME = "2100", // ATYPE = "交接班", // USEMIN = 1, // KEY_MAN = "2", // NOTE = "2" // }, // new OtherAttendChangeInfo{ // NOBR = "H000001", // ADATE = "2020/07/29", // BDATE = "2020/07/29", // EDATE = "2020/07/29", // BTIME = "1000", // ETIME = "1234", // ATYPE = "交接班", // USEMIN = 1, // KEY_MAN = "3", // NOTE = "3" // }, // new OtherAttendChangeInfo{ // NOBR = "H000001", // ADATE = "2020/07/29", // BDATE = "2020/07/29", // EDATE = "2020/07/29", // BTIME = "2222", // ETIME = "2359", // ATYPE = "交接班", // USEMIN = 1, // KEY_MAN = "4", // NOTE = "4" // }, // new OtherAttendChangeInfo{ // NOBR = "H000001", // ADATE = "2020/07/29", // BDATE = "2020/07/29", // EDATE = "2020/07/29", // BTIME = "2341", // ETIME = "2359", // ATYPE = "交接班", // USEMIN = 1, // KEY_MAN = "5", // NOTE = "5" // }, // new OtherAttendChangeInfo{ // NOBR = "H000001", // ADATE = "2020/07/29", // BDATE = "2020/07/29", // EDATE = "2020/07/29", // BTIME = "1000", // ETIME = "1111", // ATYPE = "交接班", // USEMIN = 1, // KEY_MAN = "6", // NOTE = "6" // } //}; //foreach (var o in otherAttendChangeInfosList) //{ // IAttendanceService attendanceServices = new AttendanceServiceClient(); // Object Introduction = attendanceServices.AddOtherAttendChange(o); // string json = JsonConvert.SerializeObject(Introduction); // Console.WriteLine(json.ToString()); //} }