public int CreateAppUser(string aspNetUserName) { var cmd = new SqlCommand("AppUser_Insert"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserName", aspNetUserName); return(db.Execute(cmd)); }
public bool UpdateFlightLog(FlightLog model) { var cmd = new SqlCommand("dbo.FlightLog_Update"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@FlightLogId", model.Id); cmd.Parameters.AddWithValue("@AppUserId", model.UserId); cmd.Parameters.AddWithValue("@AircraftId", model.AircraftId); cmd.Parameters.AddWithValue("@FlightBeginUtc", model.FlightBeginUtc); cmd.Parameters.AddWithValue("@FlightEndUtc", model.FlightEndUtc); cmd.Parameters.AddWithValue("@HobbsBegin", model.HobbsBegin); cmd.Parameters.AddWithValue("@HobbsEnd", model.HobbsEnd); cmd.Parameters.AddWithValue("@HobbsHours", model.HobbsHours); cmd.Parameters.AddWithValue("@NightLandings", model.NightLandings); cmd.Parameters.AddWithValue("@CreatedByUserId", model.CreatedByUserId); int rowsAffected = db.Execute(cmd); bool success = rowsAffected == 1; return(success); }