Example #1
0
        public static int deletetb(TablesMDL tb)
        {
            string sql = "delete from tables where tableid=@tableid";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@tableid", tb.tableid));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #2
0
        public static int deleteroom(RoomTypeMDL rt)
        {
            string sql = "delete from roomtype where rtid=@rtid";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@rtid", rt.rtid));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #3
0
        public static int deleteadmin(AdminsMDL a)
        {
            string sql = "delete from admins where userid=@userid";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@userid", a.userid));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #4
0
        public static int insertroom(RoomTypeMDL rt)
        {
            string sql = "insert into roomtype(rtname,rtmount) values(@rtname,@rtmount)";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@rtname", rt.rtname));
            list.Add(new SqlParameter("@rtmount", rt.rtmount));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #5
0
        public static int insertadmin(AdminsMDL ad)
        {
            string sql = "insert into admins values(@username,@userpwd,@usercompellation,1,1,1,1)";

            SqlParameter[] spt = { new SqlParameter("@username",         ad.UserName),
                                   new SqlParameter("@userpwd",          ad.UserPWD),
                                   new SqlParameter("@usercompellation", ad.UserCompellation) };
            return(DBhelper.MyExecuteNonQuery(sql, spt));
        }
Example #6
0
        public static int DeleteVip(int VipID)
        {
            string sql = "delete from Vips where VipID=@VipID";

            SqlParameter[] sp =
            {
                new SqlParameter("@VipID", VipID)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #7
0
        public static int updatepwd(AdminsMDL a, AdminsMDL aa)
        {
            string sql = "update admins set userpwd=@Uerpwd where username=@username and userpwd=@Userpwd";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@username", a.UserName));
            list.Add(new SqlParameter("@userpwd", a.UserPWD));
            list.Add(new SqlParameter("@Uerpwd", aa.UserPWD));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #8
0
        public static int logintype(AdminsMDL a)
        {
            string sql = "update admins set LoginType=@logintype where username=@username ";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@username", a.UserName));

            list.Add(new SqlParameter("@logintype", a.LoginType));
            return(Convert.ToInt32(DBhelper.MyExecuteNonQuery(sql, list.ToArray())));
        }
Example #9
0
        /// <summary>
        /// 删除商品
        /// </summary>
        /// <param name="ProductID"></param>
        /// <returns></returns>
        public static int DeleteProducts(int ProductID)
        {
            string sql = "delete from Products where ProductID=@ProductID";

            SqlParameter [] sp =
            {
                new SqlParameter("@ProductID", ProductID)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #10
0
        public static int UPTB(string YDID)
        {
            string sql_U = "update Tables set TableState=0 where TableID in (select TBID from YuDing where YDID=@YDID)";

            SqlParameter[] sp_U =
            {
                new SqlParameter("@YDID", YDID)
            };
            return(DBhelper.MyExecuteNonQuery(sql_U, sp_U));
        }
Example #11
0
        public static int updateroom(RoomTypeMDL rt)
        {
            string sql = "update roomtype set rtname=@rtname,rtmount=@rtmount where rtid=@rtid";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@rtname", rt.rtname));
            list.Add(new SqlParameter("@rtmount", rt.rtmount));
            list.Add(new SqlParameter("@rtid", rt.rtid));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #12
0
        public static int deletevg(VipGradeMDL vg)
        {
            string sql = "delete from vipgrade where vgid=@vgid";

            SqlParameter[] spt =
            {
                new SqlParameter("@vgid", vg.vgid)
            };
            return(DBhelper.MyExecuteNonQuery(sql, spt));
        }
Example #13
0
        public static int updateadmin(AdminsMDL a)
        {
            string sql = "update admins set username=@username,usercompellation=@usercompellation where userid=@userid";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@username", a.UserName));
            list.Add(new SqlParameter("@usercompellation", a.UserCompellation));
            list.Add(new SqlParameter("@userid", a.userid));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #14
0
        public static int UpTable(string CBID, int TBID)
        {
            string sql = "update ConsumerBill set TableID=@TableID where CBID=@CBID";

            SqlParameter[] sp =
            {
                new SqlParameter("@TableID", TBID),
                new SqlParameter("@CBID",    CBID),
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #15
0
        public static int UpdateTables(int TableID, int State)
        {
            string sql = "update Tables set TableState=@TableState where TableID=@TableID";

            SqlParameter[] sp =
            {
                new SqlParameter("@TableState", State),
                new SqlParameter("@TableID",    TableID)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #16
0
        public static int insertvg(VipGradeMDL vg)
        {
            string sql = "insert into vipgrade values(@vgname,@vgdiscount)";

            SqlParameter[] spt =
            {
                new SqlParameter("@vgname",     vg.vgname),
                new SqlParameter("@vgdiscount", vg.vgdiscount)
            };
            return(DBhelper.MyExecuteNonQuery(sql, spt));
        }
Example #17
0
        public static int DeleteYD(string YDID)
        {
            string sql = "delete from YuDing where YDID=@YDID";

            SqlParameter[] sp =
            {
                new SqlParameter("@YDID", YDID)
            };

            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #18
0
        public static int updatetb(TablesMDL tb)
        {
            string sql = "update tables set tablename=@tablename,rtid=@rtid,tablearea=@tablearea where tableid=@tableid";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@tablename", tb.tablename));
            list.Add(new SqlParameter("@rtid", tb.rtid));
            list.Add(new SqlParameter("@tablearea", tb.tablearea));
            list.Add(new SqlParameter("@tableid", tb.tableid));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #19
0
        public static int inserttb(TablesMDL tb)
        {
            string sql = "insert into tables values(@tablename,@rtid,@tablearea,@tablestate)";
            List <SqlParameter> list = new List <SqlParameter>();

            list.Add(new SqlParameter("@tablename", tb.tablename));
            list.Add(new SqlParameter("@rtid", tb.rtid));
            list.Add(new SqlParameter("@tablearea", tb.tablearea));
            list.Add(new SqlParameter("@tablestate", tb.tablestate));
            return(DBhelper.MyExecuteNonQuery(sql, list.ToArray()));
        }
Example #20
0
        public static int updatevg(VipGradeMDL vg)
        {
            string sql = "update vipgrade set vgname=@vgname,vgdiscount=@vgdiscount where vgid=@vgid";

            SqlParameter[] spt =
            {
                new SqlParameter("@vgname",     vg.vgname),
                new SqlParameter("@vgdiscount", vg.vgdiscount),
                new SqlParameter("@vgid",       vg.vgid)
            };
            return(DBhelper.MyExecuteNonQuery(sql, spt));
        }
Example #21
0
        public static int RemoveConsumerDetails(int PTID)
        {
            string sql = @"delete from ConsumerDetail 
        where ProdcutID=@ProdcutID 
        and CDID=(select MAX(CDID) 
        from dbo.ConsumerDetail 
        where ProdcutID=@ProdcutID)";

            SqlParameter[] sp =
            {
                new SqlParameter("@ProdcutID", PTID)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #22
0
        public static int UPCB(ConsumerBills c)
        {
            string sql = "update dbo.ConsumerBill set CBClose=1,VipID=@VipID,CBDiscount=@CBDiscount,CBEndDate=GETDATE(),AdminID=@AdminID,CBSale=@CBSale where CBID=@CBID";

            SqlParameter[] sp =
            {
                new SqlParameter("@CBID",       c.CBID),
                new SqlParameter("@VipID",      c.VipID),
                new SqlParameter("@CBDiscount", c.CBDiscount),
                new SqlParameter("@AdminID",    c.AdminID),
                new SqlParameter("@CBSale",     c.CBSale),
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #23
0
        public static int AddVip(VipsMDL v)
        {
            string sql = "insert into Vips values(@VipName,@VipSex,@GradeID,@VipTel,GETDATE(),@VipEndDate)";

            SqlParameter[] sp =
            {
                new SqlParameter("@VipName",    v.VipName),
                new SqlParameter("@VipSex",     v.VipSex),
                new SqlParameter("@GradeID",    v.GradeID),
                new SqlParameter("@VipTel",     v.VipTel),
                new SqlParameter("@VipEndDate", v.VipEndDate),
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #24
0
        /// <summary>
        /// 增加消费
        /// </summary>
        /// <param name="c"></param>
        /// <returns></returns>
        public static int AddCB(ConsumerBills c)
        {
            string sql = @"insert into ConsumerBill(CBID,TableID,CBAmount,CBStartDate,CBClose) 
                    values(@CBID,@TableID,@CBAmount,@CBStartDate,@CBClose)";

            SqlParameter[] sp =
            {
                new  SqlParameter("@CBID",        c.CBID),
                new  SqlParameter("@TableID",     c.TableID),
                new  SqlParameter("@CBAmount",    c.CBAmount),
                new  SqlParameter("@CBStartDate", c.CBStartDate),
                new  SqlParameter("@CBClose",     c.CBClose)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #25
0
        public static int UpdateVip(VipsMDL v)
        {
            string sql = "update Vips set VipName=@VipName,VipSex=@VipSex,GradeID=@GradeID,VipTel=@VipTel,VipEndDate=@VipEndDate where VipID=@VipID";

            SqlParameter[] sp =
            {
                new SqlParameter("@VipName",    v.VipName),
                new SqlParameter("@VipSex",     v.VipSex),
                new SqlParameter("@VipTel",     v.VipTel),
                new SqlParameter("@VipEndDate", v.VipEndDate),
                new SqlParameter("@GradeID",    v.GradeID),
                new SqlParameter("@VipID",      v.VipID)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #26
0
        /// <summary>
        /// 添加商品
        /// </summary>
        /// <param name="p"></param>
        /// <returns>几行受影响</returns>
        public static int AddProducts(ProductsMDL p)
        {
            string sql = "insert into Products values(@ProductName,@PTID,@ProductJP,@ProductPrice,@ProductIntroduction,@ProductPic)";

            SqlParameter[] sp =
            {
                new SqlParameter("@ProductName",         p.ProductName),
                new SqlParameter("@PTID",                p.PTID),
                new SqlParameter("@ProductJP",           p.ProductJP),
                new SqlParameter("@ProductPrice",        p.ProductPrice),
                new SqlParameter("@ProductIntroduction", p.ProductIntroduction),
                new SqlParameter("@ProductPic",          p.ProductPic)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #27
0
        /// <summary>
        /// 保存菜单
        /// </summary>
        /// <returns></returns>
        public static int AddConsumerDetails(ConsumerDetails c)
        {
            string sql = "insert into dbo.ConsumerDetail values(@CBID,@ProdcutID,@CDPrice,@CDAmount,@CDSale,@CDMoney,@CDType,GETDATE())";

            SqlParameter[] sp =
            {
                new SqlParameter("@CBID",      c.CBID),
                new SqlParameter("@ProdcutID", c.ProductID),
                new SqlParameter("@CDPrice",   c.CDPrice),
                new SqlParameter("@CDAmount",  c.CDAmount),
                new SqlParameter("@CDSale",    c.CDSale),
                new SqlParameter("@CDMoney",   c.CDMoney),
                new SqlParameter("@CDType",    c.CDType),
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #28
0
        /// <summary>
        /// 修改商品
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public static int UpdateProducts(ProductsMDL p)
        {
            string sql = @" update Products 
 set ProductName=@ProductName,PTID=@PTID,ProductPrice=@ProductPrice,ProductIntroduction=@ProductIntroduction,ProductPic=@ProductPic
 where ProductID=@ProductID";

            SqlParameter[] sp =
            {
                new SqlParameter("@ProductName",         p.ProductName),
                new SqlParameter("@PTID",                p.PTID),
                new SqlParameter("@ProductPrice",        p.ProductPrice),
                new SqlParameter("@ProductID",           p.ProductID),
                new SqlParameter("@ProductIntroduction", p.ProductIntroduction),
                new SqlParameter("@ProductPic",          p.ProductPic)
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }
Example #29
0
        public static int  AddYd(YDMDL y)
        {
            string sql = "insert into YuDing values(@YDID,@KName,@KPhone,@RTID,@TBID,@YTime,@YJ,@Price,@bz,@daoda)";

            SqlParameter[] sp =
            {
                new SqlParameter("@YDID",   y.YDID),
                new SqlParameter("@KName",  y.KName),
                new SqlParameter("@KPhone", y.KPhone),
                new SqlParameter("@RTID",   y.RTID),
                new SqlParameter("@TBID",   y.TBID),
                new SqlParameter("@YTime",  y.YTime),
                new SqlParameter("@YJ",     y.YJ),
                new SqlParameter("@Price",  y.Price),
                new SqlParameter("@bz",     y.bz),
                new SqlParameter("@daoda",  y.daoda),
            };
            return(DBhelper.MyExecuteNonQuery(sql, sp));
        }