Exemplo n.º 1
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="meterial"></param>
        /// <returns>添加是否成功</returns>
        public bool Insert(Meterial meterial)
        {
            string SQL    = SQLBuilder.BuildInsertSQL(meterial, TableName);
            int    result = Connection.ExecuteSql(SQL, meterial);

            return(result == 1 ? true : false);
        }
Exemplo n.º 2
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, bill_id = condition.bill_id });
        //    return result == 1 ? true : false;
        //}

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="bill"></param>
        /// <returns>添加是否成功</returns>
        public bool Insert(Bill bill)
        {
            string SQL    = SQLBuilder.BuildInsertSQL(bill, TableName);
            int    result = Connection.ExecuteSql(SQL, bill);

            return(result == 1 ? true : false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="dishes"></param>
        /// <returns>添加是否成功</returns>
        public bool Insert(Dishes dishes)
        {
            string SQL    = SQLBuilder.BuildInsertSQL(dishes, TableName);
            int    result = Connection.ExecuteSql(SQL, dishes);

            return(result == 1 ? true : false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns>添加是否成功</returns>
        public bool Insert(Consume consume)
        {
            string SQL    = SQLBuilder.BuildInsertSQL(consume, TableName);
            int    result = Connection.ExecuteSql(SQL, consume);

            return(result == 1 ? true : false);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="order"></param>
        /// <returns>添加是否成功</returns>
        public bool Insert(Order order)
        {
            string SQL    = SQLBuilder.BuildInsertSQL(order, TableName);
            int    result = Connection.ExecuteSql(SQL, order);

            return(result == 1 ? true : false);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="desk"></param>
        /// <returns>添加是否成功</returns>
        public bool Insert(Desk desk)
        {
            //其余取默认值
            var    deskI  = new { desk_id = desk.desk_id, desk_name = desk.desk_name };
            string SQL    = SQLBuilder.BuildInsertSQL(deskI, TableName);
            int    result = Connection.ExecuteSql(SQL, deskI);

            return(result == 1 ? true : false);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="visitRecord"></param>
        /// <returns>添加是否成功</returns>
        public bool Insert(VisitRecord visitRecord)
        {
            //不插入访问时间,数据库自动填充默认值
            var visit = new { visit_record_id = visitRecord.visit_record_id, desk_id = visitRecord.desk_id,
                              consumer_num    = visitRecord.consumer_num };
            string SQL    = SQLBuilder.BuildInsertSQL(visit, TableName);
            int    result = Connection.ExecuteSql(SQL, (Object)visit);

            return(result == 1 ? true : false);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="employee"></param>
        /// <returns>添加是否成功</returns>
        public bool Insert(Employee employee)
        {
            var em = new
            {
                employee_id   = employee.employee_id,
                employee_name = employee.employee_name,
                gender        = employee.gender,
                titel_name    = employee.titel_name,
                wage          = employee.wage,
                password      = employee.password
            };
            string SQL    = SQLBuilder.BuildInsertSQL(em, TableName);
            int    result = Connection.ExecuteSql(SQL, em);

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