예제 #1
0
        public void CriarTabelas()
        {
            _dapper.Execute(@"
                            CREATE TABLE usuario
                            (id INTEGER PRIMARY KEY,
                            nome TEXT NOT NULL,
                            cpf TEXT NULL,
                            matricula INTEGER NULL,
                            aniversario TEXT NOT NULL,
                            cep TEXT NOT NULL,
                            logradouro TEXT NOT NULL,
                            numero int NOT NULL,
                            complemento TEXT NULL,
                            cidade TEXT NOT NULL,
                            estado TEXT NOT NULL); ");

            _dapper.Execute(@"CREATE TABLE veiculo
                            (id int NOT NULL PRIMARY KEY,
                            placa varchar NOT NULL,
                            id_marca int NOT NULL,
                            id_modelo int NOT NULL,
                            ano int NOT NULL,
                            valor_hora decimal(10,2) NOT NULL,
                            combustivel int NOT NULL,
                            limite_porta_malas int NOT NULL,
                            categoria int NOT NULL);");
        }
예제 #2
0
        private int AddUserInfoToTest2(User user)
        {
            var conn = new DapperConnection("Server=.;database=test2;uid=sa;pwd=123456");

            return(conn.Execute(
                       "insert into [Users2](Id,Name,Number,Date,CreateTime) values(@Id,@Name,@Number,@Date,@CreateTime)",
                       user));
        }
예제 #3
0
        /// <summary>
        /// 生成结算流水号
        /// </summary>
        /// <param name="BM">表名</param>
        /// <returns>返回此表的流水号</returns>
        public string GetJsLsh(int qdid)
        {
            string            result     = string.Empty;
            DynamicParameters parameters = new DynamicParameters();

            parameters.Add("QDID", qdid);
            parameters.Add("LSH", result, DbType.String, ParameterDirection.Output);
            using (IDbConnection conn = new DapperConnection().DbConnection)
            {
                var res2 = conn.Execute("PROC_XT_ZZB_LSBH_V2", parameters, null, null, CommandType.StoredProcedure);
                return(parameters.Get <string>("@LSH"));
            }
        }