public async Task CanGetPayrollForms() { var svc = new DriverService(); var request = new FormsQueryRequest { UserName = "******", WeekEnding = new DateTime(2017, 1, 1), SygmaCenterNo = 22 }; var result = await svc.GetFormsAsync(request); Assert.IsNotNull(result); }
public async Task <List <PayrollForm> > GetFormsAsync(FormsQueryRequest request) { var param = new object[] { new SqlParameter("@formId", SqlDbType.Int) { Value = SqlInt32.Null, IsNullable = true }, new SqlParameter("@sygmaCenterNo", SqlDbType.Int) { Value = SqlInt32.Null, IsNullable = true }, new SqlParameter("@routeNo", SqlDbType.VarChar, 4) { Value = DBNull.Value, IsNullable = true }, new SqlParameter("@weekending", SqlDbType.DateTime) { Value = request.WeekEnding }, new SqlParameter("@fromDate", SqlDbType.DateTime) { Value = DBNull.Value, IsNullable = true }, new SqlParameter("@toDate", SqlDbType.DateTime) { Value = DBNull.Value, IsNullable = true }, new SqlParameter("@statusId", SqlDbType.Int) { Value = SqlInt32.Null, IsNullable = true }, new SqlParameter("@formTypeId", SqlDbType.Int) { Value = SqlInt32.Null, IsNullable = true }, new SqlParameter("@actualsUpdated", SqlDbType.Int) { Value = SqlInt32.Null, IsNullable = true }, new SqlParameter("@employeeString", SqlDbType.VarChar, 100) { Value = DBNull.Value, IsNullable = true }, new SqlParameter("@tractorString", SqlDbType.VarChar, 100) { Value = DBNull.Value, IsNullable = true }, new SqlParameter("@trailerString", SqlDbType.VarChar, 100) { Value = DBNull.Value, IsNullable = true }, new SqlParameter("@userName", SqlDbType.VarChar, 20) { Value = request.UserName } }; using (var Db = new AtmContext()) { var result = await Db.Database .SqlQuery <PayrollForm>("exec [up_p_getForms] @userName = {0}, @weekending = {1}", request.UserName, request.WeekEnding ).ToListAsync(); return(result); } }