void 도덕산(FlexService service) { object[] baseData = service.GetProductByBook(_도덕산, _ShopCode); // 특정 사이트 정보 //object[] result44 = service.GetScheduleByBook(_도덕산, _ShopCode, productCodeB44); //foreach (var item in result44) //{ // Schedule data = item as Schedule; // txtBox.Text += string.Format("PlayDate:{0}, RemainCount:{1}" // , data.PlayDate, data.RemainCount) + "\r\n"; //} // 해당 월 전체 정보 object[] result = service.GetScheduleByGroup(_도덕산, _ShopCode, "201508"); foreach (var item in result) { ScheduleGroup data = item as ScheduleGroup; if (data.PlayDate == "20150822" || data.PlayDate == "20150829") { txtBox.Text += string.Format("GroupCode:{0}, GroupKind:{1}, GroupName:{2}, MaxSaleCount:{3}, PlayDate:{4}, PlayDays:{5}, ProductRemainCount:{6}" , data.GroupCode, data.GroupKind, data.GroupName, data.MaxSaleCount, data.PlayDate, data.PlayDays, data.ProductRemainCount) + "\r\n"; } } //// 일자별 그룹정보 //object[] result1 = service.GetScheduleByGroupMap(_도덕산, _ShopCode, "0001", "20150822", "20150822"); //foreach (var item in result1) //{ // ProductMap data = item as ProductMap; // txtBox.Text += string.Format("GroupCode:{0}, GroupKind:{1}, GroupName:{2}, MaxSaleCount:{3}, PlayDate:{4}, PlayDays:{5}, ProductRemainCount:{6}, RemainCount:{7}, StatusCode: {8}" // , data.GroupCode, data.OptionAmount, data.OptionFlag, data.OptionName, data.OptionYn, data.ProductCode, data.ProductName, data.RemainCount, data.StatusCode) + "\r\n"; //} }
void 자라섬(FlexService service) { // B사이트 44 string productCodeB44 = "00003044"; string productCodeB46 = "00003046"; //object[] baseData = service.GetBaseData(_자라섬, _ShopCode); object[] baseData = service.GetProductByBook(_자라섬, _ShopCode); // 특정 사이트 정보 object[] result44 = service.GetScheduleByBook(_자라섬, _ShopCode, productCodeB44); foreach (var item in result44) { Schedule data = item as Schedule; txtBox.Text += string.Format("PlayDate:{0}, RemainCount:{1}" , data.PlayDate, data.RemainCount) + "\r\n"; } // 해당 월 전체 정보 object[] result = service.GetScheduleByGroup(_자라섬, _ShopCode, "201508"); // 일자별 그룹정보 object[] result1 = service.GetScheduleByGroupMap(_도덕산, _ShopCode, "0001", "20150822", "20150822"); foreach (var item in result) { ScheduleGroup data = item as ScheduleGroup; txtBox.Text += string.Format("GroupCode:{0}, GroupKind:{1}, GroupName:{2}, MaxSaleCount:{3}, PlayDate:{4}, PlayDays:{5}, ProductRemainCount:{6}" , data.GroupCode, data.GroupKind, data.GroupName, data.MaxSaleCount, data.PlayDate, data.PlayDays, data.ProductRemainCount) + "\r\n"; } foreach (var item in result1) { ProductMap data = item as ProductMap; txtBox.Text += string.Format("GroupCode:{0}, GroupKind:{1}, GroupName:{2}, MaxSaleCount:{3}, PlayDate:{4}, PlayDays:{5}, ProductRemainCount:{6}, RemainCount:{7}, StatusCode: {8}" , data.GroupCode, data.OptionAmount, data.OptionFlag, data.OptionName, data.OptionYn, data.ProductCode, data.ProductName, data.RemainCount, data.StatusCode) + "\r\n"; } }
/// <summary> /// 체크 /// </summary> /// <param name="service"></param> /// <param name="campingPlace"></param> /// <param name="shopCode"></param> /// <param name="checkDateList"></param> public void CheckReservationable(FlexService service, string campingPlace, string shopCode, List<string> checkDateList, List<string> checkGroupNameList = null) { bool validateTrue = false; string url = @"https://strawberry.mainticket.co.kr/strawberry/strawberry.aspx?companycode={0}&shopcode={1}"; object[] baseData = service.GetProductByBook(campingPlace, shopCode); List<string> checkMonthList = checkDateList.GroupBy(x => x.Substring(0, 6)).Select(x => x.Key).OrderBy(x => x).ToList(); foreach (string month in checkMonthList) { // 해당 월 전체 정보 object[] result = service.GetScheduleByGroup(campingPlace, _ShopCode, month); foreach (var item in result) { ScheduleGroup data = item as ScheduleGroup; List<string> checkDates = checkDateList.Where(x => x.StartsWith(month)).ToList(); if (checkDates.Contains(data.PlayDate)) { if (checkGroupNameList == null || CheckGroupName(checkGroupNameList, data.GroupName)) { string text = string.Format("[{7}] - GroupCode:{0}, GroupKind:{1}, GroupName:{2}, MaxSaleCount:{3}, PlayDate:{4}, PlayDays:{5}, ProductRemainCount:{6}" , data.GroupCode, data.GroupKind, data.GroupName, data.MaxSaleCount, data.PlayDate, data.PlayDays, data.ProductRemainCount, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")) + "\r\n"; DisplayText(text); if (data.ProductRemainCount > 0 && _reservationable == false) { ShowAlertForm(string.Format("{0}, {1}, {2}", campingPlace, data.GroupName, data.PlayDate)); validateTrue = true; DisplayText("\r\n" + "\r\n" + "\r\n" + " ==============> 예약가능 <====================" + "\r\n"); DisplayText(" ==============> 예약가능 <====================" + "\r\n"); DisplayText(" ==============> 예약가능 <====================" + "\r\n" + "\r\n" + "\r\n" + "\r\n"); System.Diagnostics.Process.Start(string.Format(url, campingPlace, _ShopCode)); } } } } _checkCount++; if (_checkCount > 600) { CrearDisplayText(); _checkCount = 0; } } /// 한건이라도 예약가능한 건이 있으면 TRUE _reservationable = validateTrue; }