/// <summary> /// 增加一条数据 /// </summary> public void Add(Poly model) { using (DBHelper db = DBHelper.Create()) { db.Insert<Poly>(model); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Ajax.Model.Poly model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(Ajax.Model.Poly model) { dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Poly model) { using (DBHelper db = DBHelper.Create()) { db.Update<Poly>(model); return true; } }
/// <summary> /// 获取指定缴费项的缴费策略 /// </summary> /// <param name="ItemID">缴费项</param> /// <returns></returns> public List<Poly> GetPolyListByItemID(string ItemID) { List<Poly> polyList = new List<Poly>(); string strSql = "select ID,UnitPrice,LowerBound,HignerBound from T_Poly where ItemID=@ItemID"; using (DBHelper db = DBHelper.Create()) { Dictionary<string, object> paramList = new Dictionary<string, object>(); paramList.Add("ItemID", ItemID); //polyList=db.GetList<Poly>(" and ItemID=@ItemID ", paramList, "", ""); using (System.Data.Common.DbDataReader ddr = db.ExecuteReader(strSql, paramList)) { while (ddr.Read()) { Poly p = new Poly(); p.ID = ddr["ID"].ToString(); p.UnitPrice = Convert.ToDecimal(ddr["UnitPrice"]); p.LowerBound = Convert.ToInt32(ddr["LowerBound"]); p.HignerBound = Convert.ToInt32(ddr["HignerBound"]); polyList.Add(p); } } } return polyList; }