Ejemplo n.º 1
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="desk"></param>
        /// <returns>更新是否成功</returns>
        public bool Update(Desk desk)
        {
            string SQL    = SQLBuilder.BuildUpdateSQL(desk, new { desk_id = desk.desk_id }, TableName);
            int    result = Connection.ExecuteSql(SQL, desk);

            return(result == 1 ? true : false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="meterial"></param>
        /// <returns>更新是否成功</returns>
        public bool Update(Meterial meterial)
        {
            string SQL    = SQLBuilder.BuildUpdateSQL(meterial, new { meterial_id = meterial.meterial_id }, TableName);
            int    result = Connection.ExecuteSql(SQL, meterial);

            return(result == 1 ? true : false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dishes"></param>
        /// <returns>更新是否成功</returns>
        public bool Update(Dishes dishes)
        {
            string SQL    = SQLBuilder.BuildUpdateSQL(dishes, new { dishes_id = dishes.dishes_id }, TableName);
            int    result = Connection.ExecuteSql(SQL, dishes);

            return(result == 1 ? true : false);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <returns>更新是否成功</returns>
        public bool Update(Consume consume)
        {
            string SQL    = SQLBuilder.BuildUpdateSQL(consume, new { dishes_id = consume.dishes_id }, TableName);
            int    result = Connection.ExecuteSql(SQL, consume);

            return(result == 1 ? true : false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="employee"></param>
        /// <returns>更新是否成功</returns>
        public bool Update(Employee employee)
        {
            string SQL    = SQLBuilder.BuildUpdateSQL(employee, new { employee_id = employee.employee_id }, TableName);
            int    result = Connection.ExecuteSql(SQL, employee);

            return(result == 1 ? true : false);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="order"></param>
        /// <returns>更新是否成功</returns>
        public bool Update(Order order)
        {
            string SQL    = SQLBuilder.BuildUpdateSQL(order, new { order_id = order.order_id }, TableName);
            int    result = Connection.ExecuteSql(SQL, order);

            return(result == 1 ? true : false);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="condition">删除条件</param>
        /// <returns>删除是否成功</returns>
        public bool Delete(dynamic condition)
        {
            //string SQL = SQLBuilder.BuildDeleteSQL(condition, TableName);
            //将是否删除设置为1
            string SQL    = SQLBuilder.BuildUpdateSQL(new { is_deleted = true }, condition, TableName);
            int    result = Connection.ExecuteSql(SQL, new { is_deleted = true, meterial_id = condition.meterial_id });

            return(result == 1 ? true : false);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 设置桌子的访问记录
        /// </summary>
        /// <param name="desk"></param>
        /// <returns></returns>
        public bool SetVisitRecord(Desk desk)
        {
            var    des = new { desk_id = desk.desk_id, current_record = desk.current_record };
            string SQL = SQLBuilder.BuildUpdateSQL(des,
                                                   new { desk_id = desk.desk_id },
                                                   TableName);
            int result = Connection.ExecuteSql(SQL, des);

            return(result == 1 ? true : false);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="bill"></param>
        /// <returns>更新是否成功</returns>
        public bool Update(Bill bill)
        {
            var bi = new
            {
                bill_id   = bill.bill_id,
                cost      = bill.cost,
                type      = bill.type,
                type_name = bill.type_name,
                type_id   = bill.type_id
            };
            string SQL    = SQLBuilder.BuildUpdateSQL(bi, new { bill_id = bill.bill_id }, TableName);
            int    result = Connection.ExecuteSql(SQL, (Object)bi);

            return(result == 1 ? true : false);
        }