/// <summary> /// 分页获取预约订房信息 /// </summary> /// <param name="criteria"></param> /// <returns></returns> public IList<BuyInfo> GetPageBuyInfos(int pageIndex,int pageSize,BuyInfo BuyInfo) { Hashtable hashTable = new Hashtable(); int start = (pageIndex - 1) * pageSize; hashTable.Add("start", start); hashTable.Add("pageSize", pageSize); hashTable.Add("buyinfo", BuyInfo); string sql = IBatisHelper.GetRuntimeSql(this.SqlMapper, "GetPageBuyInfos", hashTable); var reValue = SqlMapper.QueryForList<BuyInfo>("GetPageBuyInfos", hashTable); logger.Debug("GetPageBuyInfos:" + (reValue == null ? 0 : reValue.Count)); return reValue; }
// // GET: /BuyInfo/ public ActionResult Index(String id) { if (this.m_pagination == null) { this.m_pagination = new Pagination(); } BuyInfo buyInfo = new BuyInfo(); if (id != null) this.m_pagination.PageIndex = int.Parse(id); buyInfo.SitePath = Request.Url.Host; this.m_pagination.TotalCount = BuyInfoDao.Instance.GetTotalCount(buyInfo); IList<BuyInfo> lstBuyInfos = BuyInfoDao.Instance.GetPageBuyInfos(this.m_pagination.PageIndex, this.m_pagination.PageSize, buyInfo); ViewData["lstBuyInfos"] = lstBuyInfos; ViewData["pagination"] = this.m_pagination; return View(); }
public ActionResult Submit(FormCollection form) { BuyInfo buyInfo = new BuyInfo(); buyInfo.Place = form["Place"]; buyInfo.Name = form["Name"]; buyInfo.Tel = form["Tel"]; float fPrice = 0; float.TryParse(form["Price"], out fPrice); buyInfo.Price = fPrice; buyInfo.Product = form["Product"]; buyInfo.SitePath = Request.Url.Host; buyInfo.SubTime = DateTime.Now; bool result = BuyInfoDao.Instance.InsertBuyInfo(buyInfo); if (result) return Redirect("/BuyInfo/Index/1"); else return Redirect("/BuyInfo/Index/1"); }
public int GetTotalCount(BuyInfo BuyInfo) { int totalCount=0; Hashtable hashTable = new Hashtable(); hashTable.Add("buyinfo", BuyInfo); string sql = IBatisHelper.GetRuntimeSql(this.SqlMapper, "GetBuyInfoTotalCount", hashTable); var reValue=SqlMapper.QueryForObject("GetBuyInfoTotalCount", hashTable); totalCount =int.Parse(reValue.ToString()); return totalCount; }
/// <summary> /// 获取手术代码 /// </summary> /// <param name="criteria"></param> /// <returns></returns> public IList<BuyInfo> GetBuyInfos(BuyInfo BuyInfo) { var reValue = SqlMapper.QueryForList<BuyInfo>("GetBuyInfos", BuyInfo); logger.Debug("GetBuyInfos:" + (reValue == null ? 0 : reValue.Count)); return reValue; }
/// <summary> /// /// </summary> /// <param name="checkPatientModel"></param> /// <returns></returns> public bool InsertBuyInfo(BuyInfo BuyInfo) { try { SqlMapper.Insert("InsertBuyInfo", BuyInfo); return true; } catch (Exception ex) { logger.Error(ex.ToString()); return false; } }