Exemplo n.º 1
0
        /// <summary>
        /// 删除影厅
        /// </summary>
        /// <param name="en"></param>
        /// <returns></returns>
        public int delete(CinemaRoom en)
        {
            string strSql = "delete from CinemaRoom where id=@id";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@id", en.id)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 新增影厅
        /// </summary>
        /// <param name="en"></param>
        /// <returns></returns>
        public int add(CinemaRoom en)
        {
            string strSql = "insert into CinemaRoom (cinemaID, room, typeID, memo) "
                + "values (@cinemaID, @room, @typeID, @memo)";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@cinemaID", en.cinemaID),
                new SqlParameter("@room", en.room),
                new SqlParameter("@typeID", en.typeID),
                new SqlParameter("@memo", en.memo)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 修改影厅
        /// </summary>
        /// <param name="en"></param>
        /// <returns></returns>
        public int update(CinemaRoom en)
        {
            string strSql = "update CinemaRoom set cinemaID=@cinemaID, room=@room, typeID=@typeID, memo=@memo where id=@id";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@id", en.id),
                new SqlParameter("@cinemaID", en.cinemaID),
                new SqlParameter("@room", en.room),
                new SqlParameter("@typeID", en.typeID),
                new SqlParameter("@memo", en.memo)
            };

            int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param);
            return result;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 删除影厅
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult CinemaRoom_remove(string id)
        {
            CinemaRoom en = new CinemaRoom();
            en.id = Convert.ToInt32(id);

            DaCinemaRoom dal = new DaCinemaRoom();
            var result = new CustomJsonResult();
            result.Data = dal.delete(en);
            return result;
        }
Exemplo n.º 5
0
        public JsonResult CinemaRoom_edit(string id, string name, string cinema, string type, string memo)
        {
            CinemaRoom en = new CinemaRoom();
            en.id = Convert.ToInt32(id);
            en.room = name;
            en.cinemaID = Convert.ToInt32(cinema);
            en.typeID = Convert.ToInt32(type);
            en.memo = memo;

            DaCinemaRoom dal = new DaCinemaRoom();
            var result = new CustomJsonResult();
            result.Data = dal.update(en);
            return result;
        }
Exemplo n.º 6
0
        public JsonResult CinemaRoom_add(string room, string cinemaID, string typeID, string memo)
        {
            CinemaRoom en = new CinemaRoom();
            en.room = room;
            en.cinemaID = Convert.ToInt32(cinemaID);
            en.typeID = Convert.ToInt32(typeID);
            en.memo = memo;

            DaCinemaRoom dal = new DaCinemaRoom();
            var result = new CustomJsonResult();
            result.Data = dal.add(en);
            return result;
        }