Beispiel #1
0
        /// <summary>
        /// 获取最大单号
        /// </summary>
        /// <returns>最大单号</returns>
        public static string GetMaxDT()
        {
            string sql = " select MAX(CBID) from dbo.ConsumerBill where CBID like '%'+CONVERT(varchar,GETDATE(),112)+'%' ";
            object d   = DBhelper.MyExecuteScalar(sql, null);

            return(d.ToString());
        }
Beispiel #2
0
        public static string selectpwd(AdminsMDL a)
        {
            string sql = "select usercompellation from admins 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));
            return(DBhelper.MyExecuteScalar(sql, list.ToArray()).ToString());
        }
Beispiel #3
0
        public static int GetMaxID()
        {
            string sql = "select max(VipID) from dbo.Vips";
            object o   = DBhelper.MyExecuteScalar(sql, null);

            if (!(o is DBNull))
            {
                return(Convert.ToInt32(o));
            }
            else
            {
                return(0);
            }
        }
Beispiel #4
0
        public static string billYY(string Date)
        {
            string sql = "select sum(CBSale) from dbo.ConsumerBill where CBID like @Date";

            SqlParameter [] sp =
            {
                new SqlParameter("@Date", "%" + Date + "%")
            };

            object o = DBhelper.MyExecuteScalar(sql, sp);

            if (o.ToString() == "")
            {
                return("0");
            }
            return(o.ToString());
        }
Beispiel #5
0
        public static string GetCBID(int TableID)
        {
            string sql = @"select  CBID 
                                      from Tables t join ConsumerBill c 
                                      on t.TableID=c.TableID 
                                      where t.TableID=@TableID and CBClose=0 ";

            SqlParameter[] sp =
            {
                new SqlParameter("@TableID", TableID)
            };
            object c = DBhelper.MyExecuteScalar(sql, sp);

            if (c != null)
            {
                return(c.ToString());
            }
            return("尚未开单");
        }
Beispiel #6
0
        /// <summary>
        /// 查询剩余的桌子数
        /// </summary>
        /// <param name="RTID">房间类型</param>
        /// <returns>剩余的桌子数</returns>
        public static int GetTableCount(int RTID)
        {
            string sql = "select RTMount-(select COUNT(*) from Tables where RTID=@RTID) from RoomType where RTID=@RTID";

            SqlParameter[] sp =
            {
                new SqlParameter("@RTID", RTID)
            };
            object o = DBhelper.MyExecuteScalar(sql, sp);

            //有数据
            if (!(o is DBNull))
            {
                return(Convert.ToInt32(o));
            }
            else
            {
                return(10000);
            }
        }