/// <summary> /// 添加方案 /// </summary> private void Addmt() { BLL.mtPrice bllmt = new BLL.mtPrice(); int RowId = Convert.ToInt32(context.Request.QueryString["RowId"]); int MTID = Convert.ToInt32(context.Request.QueryString["MTID"]); int rtid = Convert.ToInt32(context.Request.QueryString["rtid"]); int Price = Convert.ToInt32(context.Request.QueryString["Price"]); float zdPrice = float.Parse(context.Request.QueryString["zdPrice"]); int Dayprice = Convert.ToInt32(context.Request.QueryString["Dayprice"]); int lcPrice = Convert.ToInt32(context.Request.QueryString["lcPrice"]); Model.mtPrice modelmt = new Model.mtPrice() { Price = Price, lcPrice = lcPrice, MTID = MTID, Dayprice = Dayprice, RoomType = rtid, zdPrice = zdPrice }; if (RowId == 0) { if (bllmt.GetModelList("RoomType=" + rtid + " and MTID=" + MTID).Count > 0) { context.Response.Write("不能添加重复的房型"); } else { if (bllmt.Add(modelmt) > 0) { context.Response.Write("ok"); } else { context.Response.Write("err"); } } } else { modelmt.ID = RowId; bllmt.Update(modelmt); context.Response.Write("ok"); } }
private void Bind() { BLL.room_type bllrt = new BLL.room_type(); List <Model.room_type> listrt = bllrt.GetModelList(""); foreach (Model.room_type item in listrt) { sbtext.Append("<option value='" + item.id + "'>" + item.room_name + "</option>"); } if (Request.QueryString["mtid"] != null) { int mtid = Convert.ToInt32(Request.QueryString["mtid"]); memtypeid.Value = mtid.ToString(); List <Model.mtPrice> listmt = bllmt.GetModelList("MTID=" + mtid); rep1.DataSource = listmt; rep1.DataBind(); } }