private void startImportHotelDetail() { DataBiz dataBiz = DataBiz.GetInstant(); JsResultObject re = new JsResultObject(); int i = 1; foreach (HotelModel hotel in _hotels) { if (isStop) { break; } if (this.lvImportHotels.Items.Count > 200) { this.lvImportHotels.Items.Clear(); } this.Update(); ListViewItem lvi = null; try { re.rowNum += dataBiz.ImportHotelDetail(hotel.hotelId, this.cbSubInfo.Checked).rowNum; this.tsslResult.Text = string.Format("({0}/{1}){2}:{3}导入中....", i++, _hotels.Count(), hotel.hotelId, hotel.hotelName); if (re.rowNum > 0) { lvi = new ListViewItem(new string[] { hotel.hotelId, hotel.hotelName, DateTime.Now.ToShortTimeString(), re.rowNum.ToString() }); } else { lvi = new ListViewItem(new string[] { hotel.hotelId, hotel.hotelName, DateTime.Now.ToShortTimeString(), "0" }); } } catch (Exception ex) { lvi = new ListViewItem(new string[] { hotel.hotelId, hotel.hotelName, DateTime.Now.ToShortTimeString(), "0", ex.Message }); } finally { this.lvImportHotels.Items.Add(lvi); } } }
public ActionResult DoImportFromElong(string hotelId) { JsResultObject re = new JsResultObject(); DataBiz dataBiz = DataBiz.GetInstant(); re = dataBiz.ImportHotelDetail(hotelId, true); if (re.rowNum >= 1) { re.title = "操作成功"; re.msg = string.Format("成功从eLong导入酒店:{0}", hotelId); } else { re.title = "操作失败"; re.code = JsResultObject.CODE_ERROR; } return(JsonText(re, JsonRequestBehavior.AllowGet)); }