/// <summary> /// 添加一个订单 /// </summary> /// <param name="order"></param> /// <returns></returns> public object AddOrderInfo(OrderInfo order) { string sql = "insert into OrderInfo(SubTime,Remark,Orderstate,DelFlag,SubBy,OrderMoney)values(@SubTime,@Remark,@Orderstate,@DelFlag,@SubBy,@OrderMoney);select last_insert_rowid();"; SQLiteParameter[] ps = { 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), new SQLiteParameter("@OrderMoney", order.OrderMoney) }; return(Sqlitehelper.ExecuteScalar(sql, ps)); }
/// <summary> /// 根据订单查询该订单的消费金额 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public object GetMoney(int orderId) { string sql = "select OrderMoney from OrderInfo where OrderId=@OrderId and OrderState=1 and DelFlag=0"; return(Sqlitehelper.ExecuteScalar(sql, new SQLiteParameter("@OrderId", orderId))); }
/// <summary> /// 根据餐桌ID查找该餐桌正在使用的订单 /// </summary> /// <param name="deskId"></param> /// <returns></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 OrderInfo.OrderState=1 and DeskId=@DeskId"; return(Sqlitehelper.ExecuteScalar(sql, new SQLiteParameter("@DeskId", deskId))); }
/// <summary> /// 根据会员id查询会员等级名称 /// </summary> /// <param name="id"></param> /// <returns></returns> public string GetMemmberTpNameByMemmberId(int id) { string sql = "select MemTpName from MemmberType inner join MemmberInfo on MemmberInfo.MemType=MemmberType.MemType where MemmberId=@MemmberId"; return(Sqlitehelper.ExecuteScalar(sql, new SQLiteParameter("@MemmberId", id)).ToString()); }