Ejemplo n.º 1
0
        /// <summary>
        /// 条件查询
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>查询结果</returns>
        public IList <Meterial> Select(dynamic condition)
        {
            string SQL       = SQLBuilder.BuildSelectSQL(condition, TableName);
            var    meterials = Connection.QuerySql <Meterial>(SQL, (object)condition);

            return(meterials);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 条件查询
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>查询结果</returns>
        public IList <Dishes> Select(dynamic condition)
        {
            string SQL     = SQLBuilder.BuildSelectSQL(condition, TableName);
            var    dishess = Connection.QuerySql <Dishes>(SQL, (object)condition);

            return(dishess);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询全部未删除的数据
        /// </summary>
        /// <returns>查询结果</returns>
        public IList <Meterial> SelectAll()
        {
            string SQL       = SQLBuilder.BuildSelectSQL(new { is_deleted = false }, TableName);
            var    meterials = Connection.QuerySql <Meterial>(SQL, new { is_deleted = false });

            return(meterials);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 条件查询
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>查询结果</returns>
        public IList <VisitRecord> Select(dynamic condition)
        {
            string SQL     = SQLBuilder.BuildSelectSQL(condition, TableName);
            var    records = Connection.QuerySql <VisitRecord>(SQL, (object)condition);

            return(records);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 查询全部未删除的数据
        /// </summary>
        /// <returns>查询结果</returns>
        public IList <Dishes> SelectAll()
        {
            string SQL     = SQLBuilder.BuildSelectSQL(new { is_deleted = false }, TableName);
            var    dishess = Connection.QuerySql <Dishes>(SQL, new { is_deleted = false });

            return(dishess);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 条件查询
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>查询结果</returns>
        public IList <Employee> Select(dynamic condition)
        {
            string SQL       = SQLBuilder.BuildSelectSQL(condition, TableName);
            var    employees = Connection.QuerySql <Employee>(SQL, (object)condition);

            return(employees);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 条件查询
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>查询结果</returns>
        public IList <Order> Select(dynamic condition)
        {
            string SQL    = SQLBuilder.BuildSelectSQL(condition, TableName);
            var    orders = Connection.QuerySql <Order>(SQL, (object)condition);

            return(orders);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 查询全部未删除的数据
        /// </summary>
        /// <returns>查询结果</returns>
        public IList <Consumer> SelectAll()
        {
            string SQL       = SQLBuilder.BuildSelectSQL(new { is_deleted = false }, TableName);
            var    consumers = Connection.QuerySql <Consumer>(SQL, new { is_deleted = false });

            return(consumers);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 获取材料列表
        /// </summary>
        /// <param name="dishes_id">给定菜品id</param>
        /// <returns>材料id列表</returns>
        public IList <Consume> GetConsumeMeterials(string dishes_id)
        {
            var    con       = new { dishes_id = dishes_id };
            string SQL       = SQLBuilder.BuildSelectSQL(con, TableName);
            var    meterials = Connection.QuerySql <Consume>(SQL, (Object)con);

            return(meterials);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 查看账户密码是否存在
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>
        public bool IsRight(Employee employee)
        {
            string SQL = SQLBuilder.BuildSelectSQL(new
            {
                employee_name = employee.employee_name,
                password      = employee.password
            }, TableName);
            var result = Connection.QuerySql <Employee>(SQL, employee);

            if (result.Count == 0)
            {
                return(false);
            }
            else
            {
                employee.titel_name = result[0].titel_name;
                return(true);
            }
        }