/// <summary> /// 添加投放影厅 /// </summary> /// <param name="contract">合同编号</param> /// <param name="order">订单编号</param> /// <param name="ids">影厅ID,逗号隔开</param> /// <returns></returns> public JsonResult Order_addPutin(string contract, string order, string ids) { string[] id = ids.Split(','); DaCinemaRoom dal = new DaCinemaRoom(); IList <CinemaRoom> rooms = dal.getList(id); List <PutinInfo> list = new List <PutinInfo>(); for (int i = 0; i < rooms.Count; i++) { PutinInfo en = new PutinInfo(); en.contractID = contract; en.orderID = order; en.cinemaID = rooms[i].cinemaID; en.cinemaRoomID = rooms[i].id; en.roomTypeID = rooms[i].typeID; list.Add(en); } DaPutinInfo dal1 = new DaPutinInfo(); var result = new CustomJsonResult(); result.Data = dal1.add(list); return(result); }
/// <summary> /// 添加投放影厅 /// </summary> /// <param name="ens">要投放的影厅</param> /// <returns></returns> public int add(List <PutinInfo> ens) { string strSql = ""; for (int i = 0; i < ens.Count; i++) { PutinInfo en = ens[i]; strSql += "insert into PutinInfo(contractID, orderID, cinemaID, cinemaRoomID, roomTypeID) " + "values ('" + en.contractID + "', '" + en.orderID + "', " + en.cinemaID + ", " + en.cinemaRoomID + ", " + en.roomTypeID + ") "; } int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql); return(result); }