コード例 #1
0
        /// <summary>
        /// 新增修改方法
        /// </summary>
        /// <param name="temp"></param>
        /// <param name="sql"></param>
        /// <param name="mem"></param>
        /// <returns></returns>
        public int AddAndUpdateMemmberInfo(int temp, string sql, MemmberInfo mem)
        {
            SQLiteParameter[] ps =
            {
                new SQLiteParameter("@MemName",          mem.MemName),
                new SQLiteParameter("@MemMobilePhone",   mem.MemMobilePhone),
                new SQLiteParameter("@MemAddress",       mem.MemAddress),
                new SQLiteParameter("@MemType",          mem.MemType),
                new SQLiteParameter("@MemNum",           mem.MemNum),
                new SQLiteParameter("@MemGender",        mem.MemGender),
                new SQLiteParameter("@MemDiscount",      mem.MemDiscount),
                new SQLiteParameter("@MemMoney",         mem.MemMoney),
                new SQLiteParameter("@MemIntegral",      mem.MemIntegral),
                new SQLiteParameter("@MemEndServerTime", mem.MemEndServerTime),
                new SQLiteParameter("@MemBirthdaty",     mem.MemBirthdaty)
            };

            List <SQLiteParameter> list = new List <SQLiteParameter>();

            list.AddRange(ps);
            if (temp == 1)
            {
                list.Add(new SQLiteParameter("@DelFlag", mem.DelFlag));
                list.Add(new SQLiteParameter("@SubTime", mem.SubTime));
            }
            else if (temp == 2)
            {
                list.Add(new SQLiteParameter("@MemmberId", mem.MemmberId));
            }
            return(Sqlitehelper.ExecuteNonQuery(sql, list.ToArray()));
        }
コード例 #2
0
        /// <summary>
        /// 新增和修改产品总方法
        /// </summary>
        /// <param name="cat"></param>
        /// <returns></returns>
        public int AddAndUpdateProductInfo(int temp, string sql, ProductInfo pro)
        {
            SQLiteParameter[] ps =
            {
                new SQLiteParameter("@CatId",    pro.CatId),
                new SQLiteParameter("@ProName",  pro.ProName),
                new SQLiteParameter("@ProNum",   pro.ProNum),
                new SQLiteParameter("@ProPrice", pro.ProPrice),
                new SQLiteParameter("@ProSpell", pro.ProSpell),
                new SQLiteParameter("@ProStock", pro.ProStock),
                new SQLiteParameter("@ProUnit",  pro.ProUnit),
                new SQLiteParameter("@Remark",   pro.Remark),
                new SQLiteParameter("@ProCost",  pro.ProCost)
            };
            List <SQLiteParameter> list = new List <SQLiteParameter>();

            list.AddRange(ps);
            if (temp == 3)
            {
                list.Add(new SQLiteParameter("@DelFlag", pro.DelFlag));
                list.Add(new SQLiteParameter("@SubTime", pro.SubTime));
                list.Add(new SQLiteParameter("@SubBy", pro.SubBy));
            }
            else if (temp == 4)
            {
                list.Add(new SQLiteParameter("@ProId", pro.ProId));
            }
            return(Sqlitehelper.ExecuteNonQuery(sql, list.ToArray()));
        }
コード例 #3
0
        /// <summary>
        /// 更新订单
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public int UpdateOrderInfoMoney(OrderInfo order)
        {
            string sql = "update OrderInfo set OrderState=2,OrderMemId=@OrderMemId,EndTime=@EndTime,OrderMoney=@OrderMoney,DisCount=@DisCount where OrderId=@OrderId";

            SQLiteParameter[] ps =
            {
                new SQLiteParameter("@OrderMemId", order.OrderMemId),
                new SQLiteParameter("@EndTime",    order.EndTime),
                new SQLiteParameter("@OrderMoney", order.OrderMoney),
                new SQLiteParameter("@DisCount",   order.DisCount),
                new SQLiteParameter("@OrderId",    order.OrderId)
            };
            return(Sqlitehelper.ExecuteNonQuery(sql, ps));
        }
コード例 #4
0
        /// <summary>
        /// 添加产品
        /// </summary>
        /// <param name="rop"></param>
        /// <returns></returns>
        public int AddROrderInfoProduct(R_OrderInfo_Product rop)
        {
            string sql = "insert into R_OrderInfo_Product(OrderId,ProId,DelFlag,SubTime,State,UnitCount) values (@OrderId,@ProId,@DelFlag,@SubTime,@State,@UnitCount)";

            SQLiteParameter[] ps =
            {
                new SQLiteParameter("@OrderId",   rop.OrderId),
                new SQLiteParameter("@ProId",     rop.ProId),//冗余属性
                new SQLiteParameter("@DelFlag",   rop.DelFlag),
                new SQLiteParameter("@SubTime",   rop.SubTime),
                new SQLiteParameter("@State",     rop.State),
                new SQLiteParameter("@UnitCount", rop.UnitCount)
            };
            return(Sqlitehelper.ExecuteNonQuery(sql, ps));
        }
コード例 #5
0
        /// <summary>
        /// 增加房间
        /// </summary>
        /// <param name="room"></param>
        /// <returns></returns>
        public int AddRoom(RoomInfo room)
        {
            string sql = "insert into RoomInfo(RoomName,RoomType,RoomMinimunConsume,RoomMaxConsumer,IsDefault,DelFlag,SubTime,SubBy) values(@RoomName,@RoomType,@RoomMinimunConsume,@RoomMaxConsumer,@IsDefault,@DelFlag,@SubTime,@SubBy)";

            SQLiteParameter[] ps =
            {
                new SQLiteParameter("@RoomName",           room.RoomName),
                new SQLiteParameter("@RoomType",           room.RoomType),
                new SQLiteParameter("@RoomMinimunConsume", room.RoomMinimunConsume),
                new SQLiteParameter("@RoomMaxConsumer",    room.RoomMaxConsumer),
                new SQLiteParameter("@IsDefault",          room.IsDefault),
                new SQLiteParameter("@DelFlag",            room.DelFlag),
                new SQLiteParameter("@SubTime",            room.SubTime),
                new SQLiteParameter("@SubBy",              room.SubBy)
            };
            return(Sqlitehelper.ExecuteNonQuery(sql, ps));
        }
コード例 #6
0
        /// <summary>
        /// 新增和修改商品总方法
        /// </summary>
        /// <param name="cat"></param>
        /// <returns></returns>
        public int AddAndUpdateCategoryInfo(int temp, string sql, CategoryInfo cat)
        {
            SQLiteParameter[] ps =
            {
                new SQLiteParameter("@CatName", cat.Catname),
                new SQLiteParameter("@CatNum",  cat.Catnum),
                new SQLiteParameter("@Remark",  cat.Remark)
            };
            List <SQLiteParameter> list = new List <SQLiteParameter>();

            list.AddRange(ps);
            if (temp == 1)
            {
                list.Add(new SQLiteParameter("@DelFlag", cat.Delflag));
                list.Add(new SQLiteParameter("@SubTime", cat.Subtime));
                list.Add(new SQLiteParameter("@SubBy", cat.Subby));
            }
            else if (temp == 2)
            {
                list.Add(new SQLiteParameter("@CatId", cat.Catid));
            }
            return(Sqlitehelper.ExecuteNonQuery(sql, list.ToArray()));
        }
コード例 #7
0
        /// <summary>
        /// 软删除产品
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int SoftDeleteProductInfoByProId(int id)
        {
            string sql = "update ProductInfo set Delflag=1 Where ProId=@ProId";

            return(Sqlitehelper.ExecuteNonQuery(sql, new SQLiteParameter("@ProId", id)));
        }
コード例 #8
0
        /// <summary>
        /// 添加一个中间表
        /// </summary>
        /// <param name="rod"></param>
        /// <returns></returns>
        public int AddOrderDesk(R_Order_Desk rod)
        {
            string sql = "insert into R_Order_Desk(OrderId,DeskId)values(@OrderId,@DeskId)";

            return(Sqlitehelper.ExecuteNonQuery(sql, new SQLiteParameter("@OrderId", rod.OrderId), new SQLiteParameter("@DeskId", rod.DeskId)));
        }
コード例 #9
0
        /// <summary>
        /// 退菜
        /// </summary>
        /// <param name="rOrderId"></param>
        /// <returns></returns>
        public int SoftDeleteROrderProName(int rOrderId)
        {
            string sql = "update R_OrderInfo_Product set DelFlag=1 where ROrderProId=@ROrderProId";

            return(Sqlitehelper.ExecuteNonQuery(sql, new SQLiteParameter("@ROrderProId", rOrderId)));
        }
コード例 #10
0
        /// <summary>
        /// 更改餐桌状态
        /// </summary>
        /// <param name="deskId"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public int UpdateDeskStateByDeskId(int deskId, int state)
        {
            string sql = "update DeskInfo set DeskState=@DeskState where DelFlag=0 and DeskId=@DeskId";

            return(Sqlitehelper.ExecuteNonQuery(sql, new SQLiteParameter("@DeskState", state), new SQLiteParameter("@DeskId", deskId)));
        }
コード例 #11
0
        /// <summary>
        /// 软删除商品种类
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int SoftDeleteCategoryInfoByCatId(int id)
        {
            string sql = "update CategoryInfo set Delflag=1 Where CatId=@CatId";

            return(Sqlitehelper.ExecuteNonQuery(sql, new SQLiteParameter("@CatId", id)));
        }
コード例 #12
0
        /// <summary>
        /// 更新订单表中的金额信息
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="money"></param>
        /// <returns></returns>
        public int UpdateMoney(int orderId, decimal money)
        {
            string sql = "update OrderInfo set OrderMoney=@OrderMoney where OrderId=@OrderId and DelFlag=0";

            return(Sqlitehelper.ExecuteNonQuery(sql, new SQLiteParameter("@OrderMoney", money), new SQLiteParameter("@OrderId", orderId)));
        }
コード例 #13
0
        /// <summary>
        /// 根据会员的id更新会员的卡内的钱
        /// </summary>
        /// <param name="MemmberId"></param>
        /// <param name="MemMoney"></param>
        /// <returns></returns>
        public int UpdateMoneyByMemId(int MemmberId, decimal MemMoney)
        {
            string sql = "update MemmberInfo set MemMoney=@MemMoney where DelFlag=0 and MemmberId=@MemmberId";

            return(Sqlitehelper.ExecuteNonQuery(sql, new SQLiteParameter("@MemMoney", MemMoney), new SQLiteParameter("@MemmberId", MemmberId)));
        }
コード例 #14
0
        /// <summary>
        /// 根据id修改会员的删除标识
        /// </summary>
        /// <param name="memmberId">会员的id</param>
        /// <returns>受影响的行数</returns>
        public int DeleteMemmberInfoByMemmberId(int memmberId)
        {
            string sql = "update MemmberInfo set DelFlag=1 where MemmberId=" + memmberId;

            return(Sqlitehelper.ExecuteNonQuery(sql));
        }