Ejemplo n.º 1
0
        public int AddAndUpdate(ProductInfo pro, string sql, int temp)
        {
            List <SQLiteParameter> list = new List <SQLiteParameter>();

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@CatId",    pro.CatId),
                new SQLiteParameter("@ProName",  pro.ProName),
                new SQLiteParameter("@ProCost",  pro.ProCost),
                new SQLiteParameter("@ProSpell", pro.ProSpell),
                new SQLiteParameter("@ProPrice", pro.ProPrice),
                new SQLiteParameter("@ProUnit",  pro.ProUnit),
                new SQLiteParameter("@Remark",   pro.Remark),
                new SQLiteParameter("@ProStock", pro.ProStock),
                new SQLiteParameter("@ProNum",   pro.ProNum)
            };
            list.AddRange(param);
            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()));
        }
Ejemplo n.º 2
0
        //增加修改
        private int AddAndUpdate(DeskInfo dk, string sql, int tp)
        {
            List <SQLiteParameter> list = new List <SQLiteParameter>();

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@RoomId",     dk.RoomId),
                new SQLiteParameter("@DeskName",   dk.DeskName),
                new SQLiteParameter("@DeskRemark", dk.DeskRemark),
                new SQLiteParameter("@DeskRegion", dk.DeskRegion)
            };
            list.AddRange(param);
            if (tp == 3)
            {
                list.Add(new SQLiteParameter("@DelFlag", dk.DelFlag));
                list.Add(new SQLiteParameter("@SubTime", dk.SubTime));
                list.Add(new SQLiteParameter("@SubBy", dk.SubBy));
                list.Add(new SQLiteParameter("@DeskState", dk.DeskState));
            }
            else if (tp == 4)
            {
                list.Add(new SQLiteParameter("@DeskId", dk.DeskId));
            }
            return(SqliteHelper.ExecuteNonquery(sql, list.ToArray()));
        }
Ejemplo n.º 3
0
        //temp 1是新增,2是修改
        public int AddAndUpdate(string sql, MemmberInfo mem, int temp)
        {
            List <SQLiteParameter> list = new List <SQLiteParameter>();

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@MemName",          mem.MemName),
                new SQLiteParameter("@MemMobilePhone",   mem.MemMobilePhone),
                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.AddRange(param);
            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()));
        }
Ejemplo n.º 4
0
        private int AddAndUpdate(RoomInfo room, string sql, int temp)
        {
            SQLiteParameter[] param =
            {
                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)
            };
            List <SQLiteParameter> list = new List <SQLiteParameter>();

            list.AddRange(param);
            if (temp == 1)//新增
            {
                list.Add(new SQLiteParameter("@DelFlag", room.DelFlag));
                list.Add(new SQLiteParameter("@Subtime", room.SubTime));
                list.Add(new SQLiteParameter("@SubBy", room.SubBy));
            }
            else if (temp == 2)//修改
            {
                list.Add(new SQLiteParameter("@RoomId", room.RoomId));
            }
            return(SqliteHelper.ExecuteNonquery(sql, list.ToArray()));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 向中间表插入一条数据
        /// </summary>
        /// <param name="rod">中间表对象</param>
        /// <returns></returns>
        public int AddROrderDesk(ROrderDesk rod)
        {
            string sql = "insert into R_Order_Desk(OrderId,DeskId) values(@OrderId,@DeskId)";

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@OrderId", rod.OrderId),
                new SQLiteParameter("@DeskId",  rod.DeskId)
            };
            return(SqliteHelper.ExecuteNonquery(sql, param));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 根据餐桌的id修改该餐桌的状态
        /// </summary>
        /// <param name="deskId">餐桌的id</param>
        /// <param name="temp">状态0--------空闲,1--------使用</param>
        /// <returns></returns>
        public int UpdateDeskStateByDeskId(int deskId, int temp)
        {
            string sql = "update DeskInfo set DeskState=@DeskState where DelFlag=0 and DeskId=@DeskId";

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@DeskState", temp),
                new SQLiteParameter("@DeskId",    deskId)
            };
            return(SqliteHelper.ExecuteNonquery(sql, param));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 向中间表中插入一条数据,加菜
        /// </summary>
        /// <param name="roip">对象</param>
        /// <returns></returns>
        public int AddR_OrderInfo_Product(R_OrderInfo_Product roip)
        {
            string sql = "insert into R_OrderInfo_Product(OrderId,ProId,DelFlag,SubTime,State,UnitCount) values(@OrderId,@ProId,@DelFlag,@SubTime,@State,@UnitCount)";

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@OrderId",   roip.OrderId),
                new SQLiteParameter("@ProId",     roip.ProId),
                new SQLiteParameter("@DelFlag",   roip.DelFlag),
                new SQLiteParameter("@SubTime",   roip.SubTime),
                new SQLiteParameter("@State",     roip.State),
                new SQLiteParameter("@UnitCount", roip.UnitCount)
            };

            return(SqliteHelper.ExecuteNonquery(sql, param));
        }
Ejemplo n.º 8
0
        }//合并

        private int AddAndUpdate(string sql, CategoryInfo cat, int temp)
        {
            List <SQLiteParameter> list = new List <SQLiteParameter>();

            SQLiteParameter[] param =
            {
                new SQLiteParameter("@CatName", cat.CatName),
                new SQLiteParameter("@CatNum",  cat.CatNum),
                new SQLiteParameter("@Remark",  cat.Remark)
            };
            list.AddRange(param);
            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()));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 删除产品
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteProductById(int id)
        {
            string sql = "update ProductInfo set DelFlag=1 where ProId=@ProId";

            return(SqliteHelper.ExecuteNonquery(sql, new SQLiteParameter("@ProId", id)));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 退菜
        /// </summary>
        /// <param name="ropId">中间表的主键id</param>
        /// <returns></returns>
        public int UpdateROrderProduct(int ropId)
        {
            string sql = "update R_OrderInfo_Product set DelFlag=1 where ROrderProId=@ROrderProId";

            return(SqliteHelper.ExecuteNonquery(sql, new SQLiteParameter("@ROrderProId", ropId)));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 根据房间的id删除删除
        /// </summary>
        /// <param name="roomId">房间的id</param>
        /// <returns></returns>
        public int DeleteDeskInfoByRoomId(int roomId)
        {
            string sql = "update DeskInfo set DelFlag=1 where RoomId=@RoomId";

            return(SqliteHelper.ExecuteNonquery(sql, new SQLiteParameter("@RoomId", roomId)));
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 根据会员ID删除该会员
        /// </summary>
        /// <param name="memmberId">会员id</param>
        /// <returns>受影响行数</returns>
        public int DeleteMemmberByMemmberId(int memmberId)
        {
            string sql = "update MemmberInfo set DelFlag=1 where MemmberId=@MemmberId";

            return(SqliteHelper.ExecuteNonquery(sql, new SQLiteParameter("@MemmberId", memmberId)));
        }
Ejemplo n.º 13
0
        public int DeleteCategoryById(int id)
        {
            string sql = "update CategoryInfo set DelFlag=1 where CatId=@CatId";

            return(SqliteHelper.ExecuteNonquery(sql, new SQLiteParameter("@CatId", id)));
        }