Example #1
0
        /// <summary>
        /// 插入一个订单返回该订单的id
        /// </summary>
        /// <param name="order">对象</param>
        /// <returns></returns>
        public int AddOrderInfo(OrderInfo order)
        {
            string sql = "insert into OrderInfo(SubTime,Remark,OrderState,DelFlag,SubBy) values(@SubTime,@Remark,@OrderState,@DelFlag,@SubBy);select last_insert_rowid();";

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@SubTime",    order.SubTime),
                new SQLiteParameter("@Remark",     order.Remark),
                new SQLiteParameter("@OrderState", order.OrderState),
                new SQLiteParameter("@DelFlag",    order.DelFlag),
                new SQLiteParameter("@SubBy",      order.SubBy)
            };
            return(Convert.ToInt32(SqliteHelper.ExecuteScalar(sql, param)));
        }
Example #2
0
        /// <summary>
        /// 根据餐桌的id查询该餐桌是不是空闲的
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public object SearchDeskById(int id)
        {
            string sql = "select count(*) from deskinfo where delflag=0 and deskid=@DeskId and deskState=0";

            return(SqliteHelper.ExecuteScalar(sql, new SQLiteParameter("@DeskId", id)));
        }
Example #3
0
        /// <summary>
        /// 根据餐桌的id查询正在使用的订单id
        /// </summary>
        /// <param name="deskId">餐桌的id</param>
        /// <returns>订单的id</returns>
        public object GetOrderIdByDeskId(int deskId)
        {
            string sql = "select OrderInfo.OrderId from R_Order_Desk inner join OrderInfo on R_Order_Desk.OrderId=OrderInfo.OrderId where OrderState=1 and DeskId=@DeskId";

            return(SqliteHelper.ExecuteScalar(sql, new SQLiteParameter("@DeskId", deskId)));
        }
Example #4
0
        /// <summary>
        /// 查询该房间下是否有正在使用的餐桌
        /// </summary>
        /// <param name="roomId">房间的id</param>
        /// <returns></returns>
        public object GetDeskInfoStateByRoomId(int roomId)
        {
            string sql = "select count(*) from deskinfo where delflag=0 and deskState=1 and RoomId=@RoomId";

            return(SqliteHelper.ExecuteScalar(sql, new SQLiteParameter("@RoomId", roomId)));
        }